Skip to content

Commit abe04ab

Browse files
Add GitHub Action to test mkdocs documentation build
- Addresses issue #7627 - Workflow triggers on push/PR to live-docs branch - Uses uv package manager for Python dependencies - Builds examples, reference docs, and mkdocs site - Uploads build artifacts for review - Includes strict mode for mkdocs to catch errors
1 parent 1bd59ad commit abe04ab

File tree

1 file changed

+91
-0
lines changed

1 file changed

+91
-0
lines changed

.github/workflows/mkdocs-build.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: MkDocs Documentation Build
2+
3+
# Trigger on pushes and pull requests to the live-docs branch
4+
# This is where the mkdocs documentation is being developed
5+
on:
6+
push:
7+
branches:
8+
- live-docs
9+
pull_request:
10+
branches:
11+
- live-docs
12+
# Allow manual workflow dispatch for testing
13+
workflow_dispatch:
14+
15+
jobs:
16+
build-docs:
17+
name: Build MkDocs Documentation
18+
runs-on: ubuntu-latest
19+
timeout-minutes: 20
20+
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
25+
- name: Set up Python
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version: '3.12'
29+
30+
- name: Install uv (Python package manager)
31+
uses: astral-sh/setup-uv@v5
32+
with:
33+
enable-cache: true
34+
35+
- name: Display uv version
36+
run: uv --version
37+
38+
- name: Install Python dependencies
39+
working-directory: docs
40+
run: |
41+
uv pip install --system -r requirements.txt
42+
43+
- name: Display installed packages
44+
run: uv pip list --system
45+
46+
- name: Build documentation examples
47+
working-directory: docs
48+
run: |
49+
make examples
50+
51+
- name: Build documentation reference
52+
working-directory: docs
53+
run: |
54+
make reference
55+
56+
- name: Build MkDocs site
57+
working-directory: docs
58+
run: |
59+
uv run mkdocs build --strict
60+
61+
- name: Check build output
62+
working-directory: docs
63+
run: |
64+
if [ -d "build" ]; then
65+
echo "✅ Documentation built successfully!"
66+
echo "📊 Build statistics:"
67+
du -sh build
68+
find build -type f | wc -l | xargs echo "Total files:"
69+
else
70+
echo "❌ Documentation build failed - output directory not found"
71+
exit 1
72+
fi
73+
74+
- name: Upload documentation artifacts
75+
if: always()
76+
uses: actions/upload-artifact@v4
77+
with:
78+
name: mkdocs-build-output
79+
path: docs/build/
80+
retention-days: 7
81+
if-no-files-found: warn
82+
83+
- name: Upload build logs on failure
84+
if: failure()
85+
uses: actions/upload-artifact@v4
86+
with:
87+
name: build-logs
88+
path: |
89+
docs/tmp/
90+
retention-days: 7
91+
if-no-files-found: ignore

0 commit comments

Comments
 (0)