Build Docs #5
This file contains hidden or 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: Build Docs | |
| on: | |
| workflow_dispatch: | |
| workflow_run: | |
| workflows: ["Update Data"] | |
| types: [completed] | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| jobs: | |
| build-docs: | |
| # On workflow_run, only build when the upstream run actually succeeded. | |
| # On workflow_dispatch there is no workflow_run context, so the condition | |
| # short-circuits on the first branch. | |
| if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deploy.outputs.page_url }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - uses: astral-sh/setup-uv@v4 | |
| - name: Build docs | |
| run: uvx nox -s docs | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| BASE_URL: /data | |
| - uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: docs/_build/html | |
| - id: deploy | |
| uses: actions/deploy-pages@v4 |