Repository navigation
ci(publish): clear cached HTML so the publish build renders current sources - #358
Conversation
…ources publish-2026oct12 succeeded but deployed the build cache's HTML unchanged, so jax.quantecon.org does not show autodiff from #357. The "Build HTML" step logged "updating environment: 0 added, 0 changed, 0 removed" and "no targets are out of date": the cache is extracted after the checkout, so its HTML is newer than every source file. Drop _build/html and _build/.doctrees after downloading the cache; the executed notebooks in _build/.jupyter_cache are kept. The same step landed in lecture-python.myst as QuantEcon/lecture-python.myst#1083. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟢 Approval recommended
The change is a small, correctly-placed CI step that only deletes regenerable build artifacts, matches a proven fix in a sister repo, and preserves the execution cache.
0 open findings
What changed in this PR
This PR fixes a publishing bug in the GitHub Pages workflow. When publish.yml downloads the build-cache artifact into _build (extracted after the repository checkout), the cached HTML files end up with newer modification times than every source file. As a result, Sphinx's HTML builder reports "no targets are out of date" and writes no pages, so jax.quantecon.org keeps serving stale HTML (e.g. the old autodiff content from #357) even after a successful run. The fix removes the cached HTML output and the pickled Sphinx environment so the final HTML build re-renders all pages from current sources, while preserving the executed-notebook cache so nothing re-executes unnecessarily.
Changes:
- Add a
Clear cached HTML and stale Sphinx environmentstep after the cache download that runsrm -rf _build/html _build/.doctrees. - Add an explanatory comment documenting the mtime/staleness root cause and why
_build/.jupyter_cacheis intentionally retained.
| File | Description |
|---|---|
.github/workflows/publish.yml |
Inserts a step to drop cached _build/html and _build/.doctrees after restoring the build cache, forcing a fresh HTML render while keeping the execution cache. |
The new step is correctly placed: it runs after the cache download and before the PDF/notebook/HTML build steps, which recreate _build/html (mkdir -p _build/html/_pdf, _build/html/_notebooks, and the final jb build). The LaTeX and jupyter builders write to _build/latex and _build/jupyter respectively, so removing _build/html does not disrupt them, and the execution cache in _build/.jupyter_cache (per execute_notebooks: "cache" in _config.yml) is left untouched so pages are re-rendered without re-execution. Removing both _build/html and _build/.doctrees robustly covers the pickled environment regardless of which directory the doctrees reside in. Indentation and shell: bash -l {0} are consistent with surrounding steps.
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
📖 Netlify Preview Ready!Preview URL: https://pr-358--incomparable-parfait-2417f8.netlify.app Commit: Build Info
|
publish-2026oct12succeeded but deployed the build cache's HTML unchanged, so jax.quantecon.org still shows the oldautodiff(the page carries the deploy time aslast-modified, but none of #357's text).Evidence. The run's "Build HTML" step (run 38200314576) logged
updating environment: 0 added, 0 changed, 0 removedand thenno targets are out of date, so it wrote no pages. The cache is extracted after the checkout, so its HTML is newer than every source file, and Sphinx's HTML builder decides there is nothing to rewrite. The PDF step did re-executeautodiff, which is why only the HTML is stale.Fix. After downloading the cache, drop
_build/htmland_build/.doctrees. The executed notebooks in_build/.jupyter_cacheare kept, so nothing re-executes that doesn't need to. This is the step QuantEcon/lecture-python.myst#1083 added to intermediate on 2026-10-09, after the same failure there.After merging, push a new publish tag. jax.quantecon.org/autodiff should then open with "This lecture gives an introduction to automatic differentiation using Google JAX."
🤖 Generated with Claude Code