Skip to content

Commit 8527a41

Browse files
mmckyclaude
andcommitted
CI: prune the restored _build/html before building
Mirrors QuantEcon/lecture-python-advanced.myst#374 — second repo of the nine in QuantEcon/workspace-lectures#41's scope. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 55c87c9 commit 8527a41

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,15 @@ jobs:
5555
branch: main
5656
name: build-cache
5757
path: _build
58+
# Prune the restored _build/html so files deleted from source stop being
59+
# published: sphinx copies html_static_path in but never removes stale
60+
# assets. `jb clean . --html` removes exactly _build/html, leaving
61+
# .jupyter_cache (the expensive execution cache), _build/latex and
62+
# _build/jupyter untouched. Must run BEFORE the PDF/notebook steps below,
63+
# which stage output INTO _build/html.
64+
- name: Prune restored HTML (drop stale assets deleted from source)
65+
shell: bash -l {0}
66+
run: jb clean . --html
5867
# Build Assets (Download Notebooks and PDF via LaTeX)
5968
- name: Build Download Notebooks (sphinx-tojupyter)
6069
shell: bash -l {0}

.github/workflows/publish.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,15 @@ jobs:
7272
branch: main
7373
name: build-cache
7474
path: _build
75+
# Prune the restored _build/html so files deleted from source stop being
76+
# published: sphinx copies html_static_path in but never removes stale
77+
# assets. `jb clean . --html` removes exactly _build/html, leaving
78+
# .jupyter_cache (the expensive execution cache), _build/latex and
79+
# _build/jupyter untouched. Must run BEFORE the PDF/notebook steps below,
80+
# which stage output INTO _build/html.
81+
- name: Prune restored HTML (drop stale assets deleted from source)
82+
shell: bash -l {0}
83+
run: jb clean . --html
7584
# Build Assets (Download Notebooks, PDF via LaTeX)
7685
- name: Build PDF from LaTeX
7786
shell: bash -l {0}

0 commit comments

Comments
 (0)