Skip to content

Commit e71743b

Browse files
committed
ci: Simplify GitHub Pages deployment workflow
Signed-off-by: Aaron Lippold <[email protected]>
1 parent 420e9be commit e71743b

File tree

2 files changed

+19
-35
lines changed

2 files changed

+19
-35
lines changed

.github/workflows/deploy-docs.yml

+17-32
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
name: Deploy MkDocs
2-
1+
name: Documentation Build and Deploy
32
on:
43
push:
54
branches:
@@ -20,64 +19,50 @@ jobs:
2019
uses: actions/checkout@v4
2120
with:
2221
fetch-depth: 0
23-
token: ${{ secrets.GITHUB_TOKEN }}
24-
25-
# Set up Python and cache dependencies
26-
- name: Set up Python
22+
23+
- name: Setup Python
2724
uses: actions/setup-python@v4
2825
with:
2926
python-version: 3.x
3027
cache: pip
3128
cache-dependency-path: docs/requirements.txt
3229

33-
# Install Python dependencies
34-
- name: Install Python dependencies
30+
- name: Install dependencies
3531
run: |
3632
python -m pip install --upgrade pip
33+
pip install mkdocs-material
3734
pip install -r docs/requirements.txt
3835
39-
# Set up Node.js and cache dependencies
4036
- name: Set up Node.js
4137
uses: actions/setup-node@v3
4238
with:
4339
node-version: 18
4440
cache: 'npm'
4541
cache-dependency-path: docs/package-lock.json
4642

47-
# Install Node.js dependencies
4843
- name: Install Node.js dependencies
4944
working-directory: ./docs
5045
run: npm ci || npm install
5146

52-
# Lint Markdown files (but don't fail the build)
5347
- name: Lint Markdown files
5448
working-directory: ./docs
5549
run: npm run lint || echo "Lint check skipped, continuing deployment"
50+
continue-on-error: true
5651

57-
# Check for broken links or references (but don't fail the build)
58-
- name: Check for broken links
52+
- name: Configure Git
5953
run: |
60-
cd docs
61-
npm run links || echo "Link check found issues, review logs for details"
62-
continue-on-error: true
54+
git config --global user.name "${{ github.actor }}"
55+
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
6356
64-
# Build documentation
65-
- name: Build documentation
66-
run: mkdocs build --strict
57+
- name: Ensure .nojekyll file exists
58+
run: |
59+
touch docs/.nojekyll
60+
touch .nojekyll
61+
62+
- name: Deploy documentation
63+
run: |
64+
mkdocs gh-deploy --force --clean --verbose
6765
68-
# Deploy to GitHub Pages
69-
- name: Deploy to GitHub Pages
70-
uses: JamesIves/github-pages-deploy-action@v4
71-
with:
72-
folder: site
73-
branch: gh-pages
74-
clean: true
75-
clean-exclude: |
76-
.nojekyll
77-
CNAME
78-
force: true
79-
80-
# Verify deployment
8166
- name: Verify deployment
8267
run: |
8368
echo "Documentation deployed to GitHub Pages"

mkdocs.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,5 @@ extra:
517517
link: https://saf.mitre.org
518518
name: MITRE Security Automation Framework
519519

520-
# Generate a .nojekyll file in the output directory to prevent GitHub Pages from using Jekyll
521-
extra_files:
522-
- .nojekyll
520+
# GitHub Pages configuration
521+
# Note: We're using the "Deploy from branch" model with the gh-pages branch

0 commit comments

Comments
 (0)