Repository navigation
Publish the documentation on GitHub Pages #3
Workflow file for this run
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: [ main ] | |
| pull_request: | |
| paths: | |
| - .github/workflows/docs.yml | |
| - CHANGELOG.md | |
| - README.md | |
| - UPGRADE-2.0.md | |
| - doc/** | |
| - tools/zensical/** | |
| - zensical.toml | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| # Let a deployment finish: the next one waits. | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| jobs: | |
| build: | |
| name: Build the Documentation | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v7 | |
| with: | |
| # The site is published: keep the token out of the workspace. | |
| persist-credentials: false | |
| - name: Setup Python | |
| uses: actions/setup-python@v7 | |
| with: | |
| python-version: '3.14' | |
| cache: pip | |
| cache-dependency-path: tools/zensical/requirements.txt | |
| - name: Install Zensical | |
| run: pip install -r tools/zensical/requirements.txt | |
| - name: Write the pages | |
| run: python tools/zensical/pages.py | |
| # Strict, as configured in zensical.toml: a broken link or anchor fails. | |
| - name: Build the site | |
| run: zensical build --clean | |
| - name: Upload the site | |
| if: github.ref == 'refs/heads/main' | |
| uses: actions/upload-pages-artifact@v5 | |
| with: | |
| path: site | |
| deploy: | |
| name: Deploy to GitHub Pages | |
| if: github.ref == 'refs/heads/main' | |
| needs: build | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v6 | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v5 |