actions/setup-python's pip cache needs a requirements.txt or pyproject.toml to hash, and failed the whole job without one. Putting the pin in a file rather than inline also puts it somewhere a person would look for it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
56 lines
1.3 KiB
YAML
56 lines
1.3 KiB
YAML
name: Documentation
|
|
|
|
# The docs are built on every push so a broken build is caught immediately, but
|
|
# only published once GitHub Pages has been enabled for the repository. Until the
|
|
# owner decides to publish, this job builds and stops.
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- 'docs/**'
|
|
- 'mkdocs.yml'
|
|
- '.github/workflows/docs.yml'
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
pages: write
|
|
id-token: write
|
|
|
|
concurrency:
|
|
group: pages
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.12'
|
|
cache: pip
|
|
cache-dependency-path: docs/requirements.txt
|
|
|
|
- run: pip install -r docs/requirements.txt
|
|
|
|
- run: mkdocs build --strict
|
|
|
|
- uses: actions/upload-pages-artifact@v3
|
|
with:
|
|
path: site_build
|
|
|
|
deploy:
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
# Only runs once Pages is enabled. Until then the build above still guards
|
|
# against a broken docs tree.
|
|
if: github.event_name == 'workflow_dispatch'
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deploy.outputs.page_url }}
|
|
steps:
|
|
- id: deploy
|
|
uses: actions/deploy-pages@v4
|