Skip to content

Commit 2b7c135

Browse files
committed
Runner with python and mkdocs install
1 parent a905cad commit 2b7c135

1 file changed

Lines changed: 44 additions & 6 deletions

File tree

.github/workflows/deploy-docs.yml

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,47 @@ jobs:
1414
runs-on: ubuntu-latest
1515

1616
steps:
17-
- name: Build
18-
run:
19-
mkdocs build
20-
- name: Deploy
21-
run:
22-
mkdocs gh-deploy
17+
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
with:
21+
# Ensure full history so mkdocs gh-deploy can create commits correctly
22+
fetch-depth: 0
23+
24+
- name: Set up Python
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: '3.13'
28+
29+
- name: Cache pip
30+
uses: actions/cache@v4
31+
with:
32+
path: ~/.cache/pip
33+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
34+
restore-keys: |
35+
${{ runner.os }}-pip-
36+
37+
- name: Install MkDocs and plugins
38+
run: |
39+
if [ -f requirements.txt ]; then
40+
pip install -r requirements.txt
41+
else
42+
# Basic MkDocs + Material theme as a sensible default
43+
pip install mkdocs mkdocs-material
44+
fi
45+
46+
- name: Verify MkDocs config
47+
run: |
48+
if [ ! -f mkdocs.yml ]; then
49+
echo "mkdocs.yml not found at repo root."
50+
exit 1
51+
fi
52+
mkdocs --version
53+
mkdocs build --strict
54+
55+
- name: Build
56+
run:
57+
mkdocs build
58+
- name: Deploy
59+
run:
60+
mkdocs gh-deploy

0 commit comments

Comments
 (0)