Repository navigation
feat: add site links, star count and Install App to the header #258
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: Deploy | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| # The reference pages describe behaviour that lives in the commit-check | |
| # repository, so they can drift without anything here changing. This job | |
| # reads both and fails when they disagree. | |
| docs-sync: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 | |
| with: | |
| python-version: '3.x' | |
| # The released package, deliberately unpinned. This site documents the | |
| # version a reader can actually install, so the check is only meaningful | |
| # against that — pinning would let the two drift apart silently until | |
| # somebody bumped the pin. | |
| # | |
| # This used to install from main, because the rule IDs the site documents | |
| # were merged but unreleased and PyPI would have reported a spurious | |
| # mismatch. v2.13.0 shipped them, so the exception is over. If a future | |
| # release is documented here ahead of time, point this back at main for | |
| # as long as that is true, and no longer. | |
| - name: Install the released commit-check | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install pytest commit-check | |
| - name: Check the docs against the package | |
| run: pytest tests/ -q | |
| build: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 | |
| with: | |
| python-version: '3.x' | |
| - name: Build site | |
| run: pipx run nox -s docs | |
| env: | |
| # Sumi's `repo_stars` reads the repository's star count from the | |
| # GitHub API at build time. The token keeps that lookup clear of the | |
| # anonymous rate limit runners can share; without it the build still | |
| # passes and the header shows the plain GitHub icon. | |
| GITHUB_TOKEN: ${{ github.token }} | |
| - name: Upload site as pages artifact | |
| uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0 | |
| with: | |
| name: ${{ github.event.repository.name }}_site | |
| path: ${{ github.workspace }}/site | |
| deploy: | |
| if: github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-24.04 | |
| needs: [build] | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1 | |
| with: | |
| artifact_name: ${{ github.event.repository.name }}_site |