diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3f6c3afe..cb7e84f7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,6 +45,15 @@ jobs: branch: main name: build-cache path: _build + # Prune the restored _build/html so files deleted from source stop being + # published: sphinx copies html_static_path in but never removes stale + # assets. `jb clean . --html` removes exactly _build/html, leaving + # .jupyter_cache (the expensive execution cache), _build/latex and + # _build/jupyter untouched. Must run BEFORE the PDF/notebook steps below, + # which stage output INTO _build/html. + - name: Prune restored HTML (drop stale assets deleted from source) + shell: bash -l {0} + run: jb clean . --html # Build Assets (Download Notebooks and PDF via LaTeX) - name: Build PDF from LaTeX shell: bash -l {0} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f0bf0870..4f1aec3d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -63,6 +63,15 @@ jobs: branch: main name: build-cache path: _build + # Prune the restored _build/html so files deleted from source stop being + # published: sphinx copies html_static_path in but never removes stale + # assets. `jb clean . --html` removes exactly _build/html, leaving + # .jupyter_cache (the expensive execution cache), _build/latex and + # _build/jupyter untouched. Must run BEFORE the PDF/notebook steps below, + # which stage output INTO _build/html. + - name: Prune restored HTML (drop stale assets deleted from source) + shell: bash -l {0} + run: jb clean . --html # Build Assets (Download Notebooks and PDF via LaTeX) - name: Build PDF from LaTeX shell: bash -l {0}