From 8527a4189c1e0bedb0dadd72d1f98136d7fb1ad8 Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Wed, 19 Aug 2026 09:01:32 +1000 Subject: [PATCH] CI: prune the restored _build/html before building MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .github/workflows/ci.yml | 9 +++++++++ .github/workflows/publish.yml | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 013e28d6..b36ab89d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,6 +55,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 Download Notebooks (sphinx-tojupyter) shell: bash -l {0} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9ab5c756..e61eb6d6 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -72,6 +72,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, PDF via LaTeX) - name: Build PDF from LaTeX shell: bash -l {0}