Deploy Documentation #44
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: Deploy Documentation | |
| # Docs deploy only when a public version ships: after the "Publish to PyPI" | |
| # workflow finishes successfully, or on a manual run. Routine pushes to main | |
| # (and work on develop) do NOT update the public site. | |
| on: | |
| workflow_run: | |
| workflows: ["Publish to PyPI"] | |
| types: [completed] | |
| workflow_dispatch: # allow manual rebuilds | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| # Only build on a successful publish, or when triggered manually. | |
| if: > | |
| github.event_name == 'workflow_dispatch' | |
| || github.event.workflow_run.conclusion == 'success' | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v8.2.0 | |
| - name: Set up Python | |
| run: uv python install 3.12 | |
| - name: Install dependencies | |
| run: uv sync --group docs | |
| - name: Build documentation | |
| run: uv run mkdocs build | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v4 | |
| with: | |
| path: site | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v5 |