Skip to content

CI: prune the restored _build/html before building - #616

Merged
mmcky merged 1 commit into
mainfrom
prune-restored-html
Aug 18, 2026
Merged

CI: prune the restored _build/html before building#616
mmcky merged 1 commit into
mainfrom
prune-restored-html

Conversation

@mmcky

@mmcky mmcky commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Both ci.yml and publish.yml restore the cached _build artifact and build over it. Sphinx copies html_static_path into _build/html/_static but never prunes assets that have since been removed from source, so a file deleted from this repo keeps being published — in CI previews immediately, and on the live site until a clean weekly cache rebuild happens to intervene. This made deletion verification unreliable during the migration: a reviewer looking at a preview cannot tell whether a deletion took effect.

This adds one step to both workflows, immediately after the cache restore and before the first build: jb clean . --html. The pinned jupyter-book here matches the one verified in the first rollout repo (>=1.0.4post1,<2.0): --html removes exactly _build/html and nothing else — _build/.jupyter_cache, _build/latex and _build/jupyter are untouched, so the expensive notebook execution stays cached and the cost is one Sphinx write pass. Placement is load-bearing: the step must run before the notebook and PDF steps, which stage _notebooks and _pdf into _build/html.

Sequencing: this lands ahead of the upcoming test_pwt.csv deletion in this repo, so that deletion's eventual publish clears the stale _static copy with no forced cache rebuild — the same ordering used in the first rollout repo, where the prune preceded the wave-C2 deletion.

Mirrors QuantEcon/lecture-python-advanced.myst#374 — second repo of the nine in the scope of QuantEcon/workspace-lectures#41.

🤖 Generated with Claude Code

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>
Copilot AI lite review requested due to automatic review settings August 18, 2026 23:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the GitHub Actions CI and publish workflows to prevent stale HTML assets (e.g., files deleted from the repo) from being carried forward when restoring the cached _build artifact, ensuring previews and the published site reflect deletions reliably.

Changes:

  • Add a post-cache-restore cleanup step intended to prune _build/html before any subsequent build steps stage assets back into it.
  • Apply the same pruning logic to both the PR-preview (ci.yml) and tag-publish (publish.yml) workflows.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/ci.yml Adds an _build/html prune step after restoring the _build cache to avoid publishing stale static assets in PR previews.
.github/workflows/publish.yml Adds the same _build/html prune step after restoring the _build cache to avoid stale assets reaching GH Pages releases.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/ci.yml
Comment thread .github/workflows/publish.yml
@github-actions

Copy link
Copy Markdown

@mmcky
mmcky merged commit ccb8084 into main Aug 18, 2026
5 checks passed
@mmcky
mmcky deleted the prune-restored-html branch August 18, 2026 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants