Skip to content

publish-documentation #9

publish-documentation

publish-documentation #9

# Publish library documentation to gh-pages
# Previously this was a push(master) since it's been updated to be push(tag/1.*) and dispatch_workflow(manual)
name: publish-documentation
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
tags:
- '1.*'
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner on which this job will run
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['16']
# Steps represent a sequence of tasks that will be executed as part of the job
# - Checkout gatsby branch
# - Update authentication for Github Package Registry @kenjdavidson/base16-scss
# - Build gh-pages using action
steps:
- name: Building documentation for ${{ github.ref_name }}
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Authenticate with GitHub package registry
run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.ACCESS_TOKEN }}" > ~/.npmrc
- uses: enriikke/gatsby-gh-pages-action@v2.2.1
with:
access-token: ${{ secrets.ACCESS_TOKEN }}
deploy-branch: gh-pages
working-dir: ./docs
gatsby-args: --prefix-paths