Skip to content

ci(publish): clear cached HTML so the publish build renders current sources - #358

Merged
mmcky merged 1 commit into
mainfrom
ci/publish-clear-cached-html
Oct 12, 2026
Merged

mmcky merged 1 commit into
mainfrom
ci/publish-clear-cached-html

Conversation

@mmcky

@mmcky mmcky commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

publish-2026oct12 succeeded but deployed the build cache's HTML unchanged, so jax.quantecon.org still shows the old autodiff (the page carries the deploy time as last-modified, but none of #357's text).

Evidence. The run's "Build HTML" step (run 38200314576) logged updating environment: 0 added, 0 changed, 0 removed and then no 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-execute autodiff, which is why only the HTML is stale.

Fix. After downloading the cache, drop _build/html and _build/.doctrees. The executed notebooks in _build/.jupyter_cache are 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

…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>
Copilot AI balanced review requested due to automatic review settings October 12, 2026 03:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 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 environment step after the cache download that runs rm -rf _build/html _build/.doctrees.
  • Add an explanatory comment documenting the mtime/staleness root cause and why _build/.jupyter_cache is 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.

@mmcky
mmcky merged commit 4b939ec into main Oct 12, 2026
3 checks passed
@mmcky
mmcky deleted the ci/publish-clear-cached-html branch October 12, 2026 03:47
@github-actions

Copy link
Copy Markdown

📖 Netlify Preview Ready!

Preview URL: https://pr-358--incomparable-parfait-2417f8.netlify.app

Commit: b7e0014


Build Info

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