Skip to content

Commit 50b0f03

Browse files
committed
ci(docs): pin MkDocs dependencies and improve workflow reproducibility
- Add docs/requirements.txt with pinned versions of MkDocs, Material theme, and plugins to ensure reproducible builds locally and in CI - Update docs workflow to install deps from requirements.txt instead of inline package names, and wire `cache-dependency-path` to the new file so pip cache hits are deterministic - Bump actions/upload-pages-artifact and actions/deploy-pages to v5 - Add `_mkdocs/` to the SOURCE_DIR_PREFIXES exclusion list in hooks.py - Add pyenv and venv to the cspell dictionary - Minor formatting fixes (branch list spacing, comment alignment)
1 parent 07ea916 commit 50b0f03

4 files changed

Lines changed: 33 additions & 7 deletions

File tree

.github/workflows/docs.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ on:
1717
- "cmd/hypercache-server/README.md"
1818
- ".github/workflows/docs.yml"
1919
push:
20-
branches: [main]
20+
branches: [ main ]
2121
paths:
2222
- "docs/**"
2323
- "mkdocs.yml"
@@ -48,20 +48,23 @@ jobs:
4848
steps:
4949
- uses: actions/checkout@v6
5050
with:
51-
fetch-depth: 0 # docs/ may reference files via relative paths
51+
fetch-depth: 0 # docs/ may reference files via relative paths
5252

5353
- name: Setup Python
5454
uses: actions/setup-python@v6
5555
with:
5656
python-version: "3.13"
5757
cache: pip
58+
# `actions/setup-python` uses this file's hash as the
59+
# pip-cache key. docs/requirements.txt pins the MkDocs
60+
# + plugin versions so cache hits are reproducible and
61+
# the runner can find a key file at all.
62+
cache-dependency-path: docs/requirements.txt
5863

5964
- name: Install MkDocs + plugins
6065
run: |
6166
python -m pip install --upgrade pip
62-
pip install mkdocs-material \
63-
mkdocs-include-markdown-plugin \
64-
mkdocs-glightbox
67+
pip install -r docs/requirements.txt
6568
6669
- name: Build site (strict)
6770
# Strict in CI catches broken links / missing pages on PR;
@@ -70,7 +73,7 @@ jobs:
7073

7174
- name: Upload Pages artifact
7275
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
73-
uses: actions/upload-pages-artifact@v3
76+
uses: actions/upload-pages-artifact@v5
7477
with:
7578
path: ./site
7679

@@ -86,4 +89,4 @@ jobs:
8689
steps:
8790
- name: Deploy to GitHub Pages
8891
id: deployment
89-
uses: actions/deploy-pages@v4
92+
uses: actions/deploy-pages@v5

_mkdocs/hooks.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
"__examples/",
5252
".github/",
5353
"docker/",
54+
"_mkdocs/",
5455
)
5556

5657
LINK_RE = re.compile(r"\[([^\]]+)\]\(([^)]+)\)")

cspell.config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ words:
174174
- protoc
175175
- pushd
176176
- pygments
177+
- pyenv
177178
- pymdownx
178179
- recvcheck
179180
- rediscluster
@@ -219,6 +220,7 @@ words:
219220
- upserted
220221
- upserts
221222
- varnamelen
223+
- venv
222224
- vettool
223225
- vnode
224226
- vnodes

docs/requirements.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Pinned dependency set for the MkDocs site build. Used by both
2+
# `make docs-build` (via the operator's pyenv `mkdocs` venv) and
3+
# `.github/workflows/docs.yml` (via actions/setup-python with
4+
# `cache: pip` — the file's hash is the cache key, so pinned
5+
# versions also produce reproducible cache hits).
6+
#
7+
# Bump deliberately: the Material theme moves fast and changes
8+
# can shift visual output. Verify with `mkdocs build --strict`
9+
# locally before bumping.
10+
11+
12+
# Transitive deps that Material relies on. Pinned for the same
13+
# reproducibility reason as the plugins above.
14+
Markdown==3.10.2
15+
mkdocs==1.6.1
16+
mkdocs-glightbox==0.5.2
17+
mkdocs-include-markdown-plugin==7.2.2
18+
mkdocs-material==9.7.6
19+
mkdocs-material-extensions==1.3.1
20+
Pygments==2.20.0

0 commit comments

Comments
 (0)