Updated github pages publishing workflow #24
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish to github pages | |
on: | |
push: | |
branches: ["master"] | |
workflow_dispatch: | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node.js environment | |
uses: actions/[email protected] | |
with: | |
node-version: 20 | |
- name: Build palaten_api spec | |
run: npx redoc-cli build -o build/openapi/palaten_api/index.html openapi/palaten_api.yaml | |
- name: Build Vuepress | |
run: cd docs && npm install && npm run build && mv src/.vuepress/dist/* ../build | |
- name: Archive artifact | |
shell: sh | |
if: runner.os == 'Linux' | |
run: | | |
echo ::group::Archive artifact | |
tar \ | |
--dereference --hard-dereference \ | |
--directory "./build" \ | |
-cvf "$RUNNER_TEMP/artifact.tar" \ | |
--exclude=.git \ | |
--exclude=.github \ | |
. | |
echo ::endgroup:: | |
- name: Upload GitHub Pages artifact | |
uses: actions/[email protected] | |
with: | |
path: ${{ runner.temp }}/artifact.tar | |
- name: Deploy GitHub Pages site | |
uses: actions/[email protected] |