Include docs static files in Pages build #61
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: Documentation | |
| on: | |
| push: | |
| branches: ["master"] | |
| workflow_call: | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| # Set permissions at the job level. | |
| permissions: {} | |
| # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
| # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| name: Build documentation with Sphinx | |
| runs-on: ubuntu-slim | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.14" | |
| cache: 'pip' | |
| - run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install . --group=docs | |
| python -m pip list | |
| - run: | | |
| sphinx-build --builder html docs/source/ docs/build/html | |
| - name: Upload artifact (only on push to master) | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/master' | |
| uses: actions/upload-pages-artifact@v5 | |
| with: | |
| path: './docs/build/html' | |
| deploy: | |
| name: Deploy documentation to GitHub Pages | |
| needs: build | |
| # Deploy only on push to master | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/master' | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-slim | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v5 |