|
| 1 | +# Docs - Github Actions |
| 2 | +# |
| 3 | +# Builds the MkDocs site with --strict, so broken links, missing nav entries and |
| 4 | +# unresolved mkdocstrings cross-references fail the pull request instead of only |
| 5 | +# surfacing in the Read the Docs build after merge. |
| 6 | +# |
| 7 | +# Used actions: |
| 8 | +# - actions/checkout |
| 9 | +# repo: https://github.com/actions/checkout |
| 10 | +# releases: https://github.com/actions/checkout/tags |
| 11 | +# |
| 12 | +# - astral-sh/setup-uv: set up uv environment |
| 13 | +# repo: https://github.com/astral-sh/setup-uv |
| 14 | +# releases: https://github.com/astral-sh/setup-uv/tags |
| 15 | +# docs: https://docs.astral.sh/uv/guides/integration/github/ |
| 16 | + |
| 17 | + |
| 18 | +name: Docs 📗 |
| 19 | + |
| 20 | +concurrency: |
| 21 | + # see https://docs.github.com/en/actions/using-jobs/using-concurrency |
| 22 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 23 | + |
| 24 | +env: |
| 25 | + # Silence Material for MkDocs' MkDocs-2.0 stderr banner (it is not a build warning) |
| 26 | + DISABLE_MKDOCS_2_WARNING: "true" |
| 27 | + |
| 28 | + # Pin uv version for reproducible builds |
| 29 | + # https://github.com/astral-sh/uv/releases |
| 30 | + UV_VERSION: "0.12.6" |
| 31 | + |
| 32 | +on: |
| 33 | + pull_request: |
| 34 | + types: [opened, reopened, synchronize] |
| 35 | + push: |
| 36 | + branches: |
| 37 | + - main |
| 38 | + |
| 39 | +permissions: |
| 40 | + contents: read |
| 41 | + |
| 42 | +jobs: |
| 43 | + build: |
| 44 | + name: mkdocs build --strict |
| 45 | + runs-on: ubuntu-latest |
| 46 | + timeout-minutes: 5 |
| 47 | + steps: |
| 48 | + |
| 49 | + # repo: https://github.com/actions/checkout |
| 50 | + # releases: https://github.com/actions/checkout/tags |
| 51 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 52 | + with: |
| 53 | + persist-credentials: false |
| 54 | + |
| 55 | + # repo: https://github.com/astral-sh/setup-uv |
| 56 | + # releases: https://github.com/astral-sh/setup-uv/tags |
| 57 | + # docs: https://docs.astral.sh/uv/guides/integration/github |
| 58 | + - name: Install pinned version of uv |
| 59 | + uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 |
| 60 | + with: |
| 61 | + cache-dependency-glob: "uv.lock" |
| 62 | + enable-cache: true |
| 63 | + prune-cache: true |
| 64 | + python-version: "3.14" # match tools.python in .readthedocs.yaml |
| 65 | + version: ${{ env.UV_VERSION }} |
| 66 | + |
| 67 | + # Mirrors the Read the Docs build: only the "docs" group, project included so |
| 68 | + # mkdocstrings can import autoread_dotenv from src/. |
| 69 | + - name: Install docs dependencies |
| 70 | + run: uv sync --only-group docs |
| 71 | + |
| 72 | + - name: Build the docs |
| 73 | + run: uv run mkdocs build --strict |
0 commit comments