1- # GitHub Actions workflow for deploying MkDocs documentation to Cloudflare Pages
2- # This workflow builds and deploys your MkDocs site when changes are pushed to main
3- name : Deploy MkDocs Documentation
1+ name : Deploy Documentation
42
53on :
64 # Trigger on push to main branch
119 # Only run when docs files change
1210 paths :
1311 - ' docs/**'
14- - ' README.md' # README is synced to docs/index.md
15- - ' mkdocs.yml'
16- - ' requirements-docs.txt'
17- - ' .github/workflows/deploy-docs.yml'
18- - ' scripts/fix-mkdocs-structure.ts'
12+ - ' apps/edit-docs/**'
13+ - ' packages/share-theme/**'
1914
2015 # Allow manual triggering from Actions tab
2116 workflow_dispatch :
2722 - master
2823 paths :
2924 - ' docs/**'
30- - ' README.md' # README is synced to docs/index.md
31- - ' mkdocs.yml'
32- - ' requirements-docs.txt'
33- - ' .github/workflows/deploy-docs.yml'
34- - ' scripts/fix-mkdocs-structure.ts'
25+ - ' apps/edit-docs/**'
26+ - ' packages/share-theme/**'
3527
3628jobs :
3729 build-and-deploy :
38- name : Build and Deploy MkDocs
30+ name : Build and Deploy Documentation
3931 runs-on : ubuntu-latest
4032 timeout-minutes : 10
4133
@@ -49,72 +41,25 @@ jobs:
4941 steps :
5042 - name : Checkout Repository
5143 uses : actions/checkout@v5
52- with :
53- fetch-depth : 0 # Fetch all history for git info and mkdocs-git-revision-date plugin
54-
55- - name : Setup Python
56- uses : actions/setup-python@v6
57- with :
58- python-version : ' 3.14'
59- cache : ' pip'
60- cache-dependency-path : ' requirements-docs.txt'
6144
62- - name : Install MkDocs and Dependencies
63- run : |
64- pip install --upgrade pip
65- pip install -r requirements-docs.txt
66- env :
67- PIP_DISABLE_PIP_VERSION_CHECK : 1
68-
69- # Setup pnpm before fixing docs structure
7045 - name : Setup pnpm
7146 uses : pnpm/action-setup@v4
7247
73- # Setup Node.js with pnpm
7448 - name : Setup Node.js
7549 uses : actions/setup-node@v6
7650 with :
77- node-version : ' 22 '
51+ node-version : ' 24 '
7852 cache : ' pnpm'
7953
80- # Install Node.js dependencies for the TypeScript script
8154 - name : Install Dependencies
82- run : |
83- pnpm install --frozen-lockfile
55+ run : pnpm install --frozen-lockfile
8456
85- - name : Fix Documentation Structure
86- run : |
87- # Fix duplicate navigation entries by moving overview pages to index.md
88- pnpm run chore:fix-mkdocs-structure
89-
90- - name : Build MkDocs Site
91- run : |
92- # Build with strict mode but allow expected warnings
93- mkdocs build --verbose || {
94- EXIT_CODE=$?
95- # Check if the only issue is expected warnings
96- if mkdocs build 2>&1 | grep -E "WARNING.*(README|not found)" && \
97- [ $(mkdocs build 2>&1 | grep -c "ERROR") -eq 0 ]; then
98- echo "✅ Build succeeded with expected warnings"
99- mkdocs build --verbose
100- else
101- echo "❌ Build failed with unexpected errors"
102- exit $EXIT_CODE
103- fi
104- }
105-
106- - name : Fix HTML Links
107- run : |
108- # Remove .md extensions from links in generated HTML
109- pnpm tsx ./scripts/fix-html-links.ts site
57+ - name : Trigger build of documentation
58+ run : pnpm docs:build
11059
11160 - name : Validate Built Site
11261 run : |
113- # Basic validation that important files exist
11462 test -f site/index.html || (echo "ERROR: site/index.html not found" && exit 1)
115- test -f site/sitemap.xml || (echo "ERROR: site/sitemap.xml not found" && exit 1)
116- test -d site/assets || (echo "ERROR: site/assets directory not found" && exit 1)
117- echo "✅ Site validation passed"
11863
11964 - name : Deploy
12065 uses : ./.github/actions/deploy-to-cloudflare-pages
0 commit comments