File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : build-docs
2+
3+ on :
4+ pull_request :
5+ types : [labeled, synchronize, closed]
6+
7+ concurrency :
8+ group : preview-${{ github.ref }}
9+ cancel-in-progress : true
10+
11+ permissions :
12+ contents : write
13+ pull-requests : write
14+
15+ jobs :
16+ build :
17+ if : >-
18+ github.event.action != 'closed' &&
19+ contains(github.event.pull_request.labels.*.name, 'check-page')
20+ runs-on : ubuntu-latest
21+ steps :
22+ - uses : actions/checkout@v4
23+
24+ - uses : actions/setup-python@v5
25+ with :
26+ python-version : " 3.10"
27+
28+ - name : Install dependencies
29+ run : |
30+ pip install -r requirements.txt
31+ sudo apt-get update && sudo apt-get install -y doxygen
32+
33+ - name : Generate API Reference
34+ env :
35+ BASE_REF : ${{ github.event.pull_request.base.ref }}
36+ run : ./generate_api.sh "$BASE_REF"
37+
38+ - name : Build docs
39+ run : mkdocs build -f mkdocs.yaml --strict
40+
41+ - uses : rossjrw/pr-preview-action@v1
42+ with :
43+ source-dir : ./site/
44+
45+ cleanup :
46+ if : github.event.action == 'closed'
47+ runs-on : ubuntu-latest
48+ steps :
49+ - uses : actions/checkout@v4
50+
51+ - uses : rossjrw/pr-preview-action@v1
52+ with :
53+ action : remove
Original file line number Diff line number Diff line change @@ -16,3 +16,10 @@ pre-commit install
1616```
1717
1818From then on, ` git commit ` will run ` markdownlint --fix ` automatically against the staged Markdown files.
19+
20+ ### Docs build check & PR preview
21+
22+ Apply the ` check-page ` label to a PR to trigger a full documentation build
23+ (` mkdocs build --strict ` , including Doxygen API reference generation). If the
24+ build succeeds, a live preview is deployed to GitHub Pages and linked from the
25+ PR. The preview is removed automatically when the PR is closed.
You can’t perform that action at this time.
0 commit comments