Context
Each docs CI job in .github/workflows/github-pages-mkdocs.yml previously carried a 4-step
preamble (setup-python → restore .jupyter_cache → pip install jupyter nbconvert ipykernel
→ run scripts/prep_notebooks.py) before handing off to the shared mkdocs-deploy composite
action. That logic is now available directly inside the composite via a notebooks-path
input, so every serapeum-org repo using the composite gets the same cache semantics
without maintaining a local copy.
Tracks the work in PR #184 on branch ci/move-notebook-ci-to-github-actions.
Problem / Current Behaviour
- Three jobs (
deploy-pr, deploy-main, deploy-release) each duplicate ~15 lines of
notebook-prep setup in the workflow file.
scripts/prep_notebooks.py (90 lines) is a repo-local re-implementation of the
cache-aware notebook prep logic that now lives in the shared composite action.
- Drift risk: any future improvement to the prep logic (e.g. cache-key strategy, exec
timeouts) must be applied in every repo.
Affected locations
| File |
Symbol |
Notes |
.github/workflows/github-pages-mkdocs.yml |
deploy-pr, deploy-main, deploy-release |
Remove setup-python / cache / prep steps; pass notebooks-path to composite. |
scripts/prep_notebooks.py |
module |
Delete; responsibility moves to composite action. |
mkdocs.yml |
mkdocs-jupyter plugin block |
Remove now-stale comment referencing prep_notebooks.py. |
pyproject.toml |
[project.optional-dependencies].docs |
Add nbconvert, ipykernel so local mkdocs serve still renders outputs. |
uv.lock |
— |
Refresh lockfile with the two new docs deps. |
Motivation Example
Before (per job, ~15 lines):
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Restore jupyter notebook cache
uses: actions/cache@v4
with:
path: .jupyter_cache
key: jupyter-cache-${{ hashFiles('docs/notebook/**/*.ipynb', 'src/statista/**/*.py', 'pyproject.toml') }}
restore-keys: |
jupyter-cache-
- name: Prepare notebook outputs (execute uncached, merge cached)
run: |
pip install -e . jupyter nbconvert ipykernel
python scripts/prep_notebooks.py
- uses: serapeum-org/github-actions/actions/mkdocs-deploy@mkdocs/v1
with:
trigger: 'pull_request'
...
After (per job):
- uses: serapeum-org/github-actions/actions/mkdocs-deploy@mkdocs/v1
with:
trigger: 'pull_request'
notebooks-path: 'docs/notebook'
...
Proposed Solution
- In
.github/workflows/github-pages-mkdocs.yml, drop the setup-python, actions/cache,
and prep_notebooks.py steps from all three jobs.
- Add
notebooks-path: 'docs/notebook' to the serapeum-org/github-actions/actions/mkdocs-deploy@mkdocs/v1
invocation in each job.
- Delete
scripts/prep_notebooks.py.
- Remove the now-stale
mkdocs-jupyter plugin comment referencing the deleted script in
mkdocs.yml.
- Add
nbconvert and ipykernel to [project.optional-dependencies].docs in
pyproject.toml so uv run --active mkdocs serve continues to render notebook outputs
locally.
- Refresh
uv.lock with uv lock.
Out of Scope
- Upstream changes to
serapeum-org/github-actions/actions/mkdocs-deploy itself — those
live in the composite action repo.
- Any documentation-content changes.
- Migrating other serapeum-org repos to the same pattern.
Effort Estimate
Size: S
Rationale: Half-day task, mostly deletion; implementation already sits in PR #184.
Definition of Done
Context
Each docs CI job in
.github/workflows/github-pages-mkdocs.ymlpreviously carried a 4-steppreamble (setup-python → restore
.jupyter_cache→pip install jupyter nbconvert ipykernel→ run
scripts/prep_notebooks.py) before handing off to the shared mkdocs-deploy compositeaction. That logic is now available directly inside the composite via a
notebooks-pathinput, so every
serapeum-orgrepo using the composite gets the same cache semanticswithout maintaining a local copy.
Tracks the work in PR #184 on branch
ci/move-notebook-ci-to-github-actions.Problem / Current Behaviour
deploy-pr,deploy-main,deploy-release) each duplicate ~15 lines ofnotebook-prep setup in the workflow file.
scripts/prep_notebooks.py(90 lines) is a repo-local re-implementation of thecache-aware notebook prep logic that now lives in the shared composite action.
timeouts) must be applied in every repo.
Affected locations
.github/workflows/github-pages-mkdocs.ymldeploy-pr,deploy-main,deploy-releasenotebooks-pathto composite.scripts/prep_notebooks.pymkdocs.ymlmkdocs-jupyterplugin blockprep_notebooks.py.pyproject.toml[project.optional-dependencies].docsnbconvert,ipykernelso localmkdocs servestill renders outputs.uv.lockMotivation Example
Before (per job, ~15 lines):
After (per job):
Proposed Solution
.github/workflows/github-pages-mkdocs.yml, drop thesetup-python,actions/cache,and
prep_notebooks.pysteps from all three jobs.notebooks-path: 'docs/notebook'to theserapeum-org/github-actions/actions/mkdocs-deploy@mkdocs/v1invocation in each job.
scripts/prep_notebooks.py.mkdocs-jupyterplugin comment referencing the deleted script inmkdocs.yml.nbconvertandipykernelto[project.optional-dependencies].docsinpyproject.tomlsouv run --active mkdocs servecontinues to render notebook outputslocally.
uv.lockwithuv lock.Out of Scope
serapeum-org/github-actions/actions/mkdocs-deployitself — thoselive in the composite action repo.
Effort Estimate
Size:
SRationale: Half-day task, mostly deletion; implementation already sits in PR #184.
Definition of Done
deploy-pr,deploy-main, anddeploy-releasejobs all succeed on PR move the ci running of the notebooks and caching them to github-actio… #184deploy-prexecutes notebooks; a re-run on the same SHA is servedfrom the composite's cache (no re-execution)
scripts/prep_notebooks.pyis removed from the treeuv run --active mkdocs servestill renders notebook outputs locallyuv.lockrevisionfield change (3 → 2) is either confirmed intentional orrestored to
3main