Skip to content

Commit 2f7fa61

Browse files
Staacksclaude
andcommitted
Make CI a check, not a deployment
The workflow targeted GitHub Pages, which this repository cannot use while it is private on a plan without it - so every push would have failed at the deploy job. Deployment is manual and tied to a phyphox release anyway. What remains is the part that has value: mkdocs build --strict on every push and pull request, which now also rejects a broken heading anchor, an invalid openapi.yaml, an inconsistency id that does not exist, and anything that would make a visitor's browser fetch from a third party. The rendered site is uploaded as a short-lived artifact so a reviewer can look at it without it being published anywhere. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 6f0ed9d commit 2f7fa61

3 files changed

Lines changed: 62 additions & 43 deletions

File tree

.github/workflows/build.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Build documentation
2+
3+
# Checks only - nothing is published from CI. The site is deployed to
4+
# phyphox.org by hand, alongside a phyphox release; see README.md. GitHub Pages
5+
# is not an option anyway while this repository is private and the plan does not
6+
# include it, and a deploy job that cannot succeed is worse than none.
7+
#
8+
# `mkdocs build --strict` is not just a build. Via tools/hooks.py it also fails on
9+
# - a broken internal link or heading anchor,
10+
# - an invalid openapi.yaml,
11+
# - an {{inconsistency:...}} marker or x-phyphox-inconsistency naming an id that
12+
# is not in inconsistencies.yml,
13+
# - anything in the generated site that would make a visitor's browser fetch
14+
# from a third party.
15+
16+
on:
17+
push:
18+
branches: [main]
19+
pull_request:
20+
workflow_dispatch:
21+
22+
permissions:
23+
contents: read
24+
25+
jobs:
26+
build:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v4
30+
- uses: actions/setup-python@v5
31+
with:
32+
python-version: "3.12"
33+
cache: pip
34+
- run: pip install -r requirements.txt
35+
- run: mkdocs build --strict
36+
37+
# Lets a reviewer download the rendered site from the run without anything
38+
# being published. Retention is short because it is a preview, not a
39+
# release artifact.
40+
- uses: actions/upload-artifact@v4
41+
with:
42+
name: site
43+
path: site/
44+
retention-days: 7

.github/workflows/deploy.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,24 @@ navigation entries into errors, so build that way before pushing:
3232
.venv/bin/mkdocs build --strict
3333
```
3434

35+
## Deploying
36+
37+
The site is **not** published from CI. `mkdocs build --strict` runs on every push
38+
and pull request as a check, and uploads the rendered site as a downloadable
39+
artifact, but nothing is deployed.
40+
41+
Deployment is a manual step taken alongside a phyphox release, so that the
42+
documentation and the app it describes ship together:
43+
44+
```bash
45+
.venv/bin/mkdocs build --strict
46+
rsync -avz --delete site/ <user>@phyphox.org:/var/www/docs/
47+
```
48+
49+
`site_url` in `mkdocs.yml` is already set to `https://phyphox.org/docs/`; change
50+
it if the site moves, or search links and the sitemap will point at the wrong
51+
host.
52+
3553
## Layout
3654

3755
```

0 commit comments

Comments
 (0)