Skip to content

Commit 6b82ed6

Browse files
committed
ci: build the docs site on pull requests
Nothing in CI built the MkDocs site, and the path filters had no entry for docs/** or mkdocs.yml, so docs and docs-toolchain changes ran no checks at all. A broken build only surfaced on Read the Docs after merge, where the previous version keeps being served. Add a `docs` path filter and a `docs-build` job that installs docs/requirements.txt on Python 3.10 (matching .readthedocs.yaml) and runs `mkdocs build --strict`, so warnings such as links to missing pages fail the PR. Note: `--strict` must not be combined with `-q`; with MkDocs 1.6 the quiet flag stops warnings from being counted and the build passes. Signed-off-by: mday-io <mdaytn@gmail.com>
1 parent df30765 commit 6b82ed6

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

‎.github/workflows/pr.yaml‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
vscode: ${{ steps.filter.outputs.vscode }}
2020
lsp: ${{ steps.filter.outputs.lsp }}
2121
ci: ${{ steps.filter.outputs.ci }}
22+
docs: ${{ steps.filter.outputs.docs }}
2223
steps:
2324
- uses: actions/checkout@v7
2425
- uses: dorny/paths-filter@v4
@@ -44,6 +45,10 @@ jobs:
4445
- '.github/**'
4546
- 'Makefile'
4647
- '.pre-commit-config.yaml'
48+
docs:
49+
- 'docs/**'
50+
- 'mkdocs.yml'
51+
- '.readthedocs.yaml'
4752
4853
doc-tests:
4954
needs: changes
@@ -71,6 +76,33 @@ jobs:
7176
source .venv/bin/activate
7277
make doc-test
7378
79+
docs-build:
80+
needs: changes
81+
if:
82+
needs.changes.outputs.docs == 'true' || needs.changes.outputs.ci ==
83+
'true' || github.ref == 'refs/heads/main'
84+
runs-on: ubuntu-latest
85+
env:
86+
UV: '1'
87+
steps:
88+
- uses: actions/checkout@v7
89+
- name: Set up Python
90+
# Match the Python version Read the Docs builds with (.readthedocs.yaml)
91+
uses: actions/setup-python@v7
92+
with:
93+
python-version: '3.10'
94+
- name: Install uv
95+
uses: astral-sh/setup-uv@v7
96+
- name: Install dependencies
97+
run: |
98+
uv venv .venv
99+
source .venv/bin/activate
100+
make install-doc
101+
- name: Build docs
102+
run: |
103+
source .venv/bin/activate
104+
mkdocs build --strict
105+
74106
style-and-cicd-tests:
75107
needs: changes
76108
if:

0 commit comments

Comments
 (0)