Skip to content

Render on PRs before merging, and drop the figure from Projects - #4

Merged
zorian15 merged 2 commits into
mainfrom
ci-render-check-on-prs
Aug 2, 2026
Merged

Render on PRs before merging, and drop the figure from Projects#4
zorian15 merged 2 commits into
mainfrom
ci-render-check-on-prs

Conversation

@zorian15

@zorian15 zorian15 commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Two changes. The CI one is the substance; the figure removal rode along.

Render on PRs

publish.yml only triggered on push to main, so nothing verified a change until it was already live on the site. Now:

  • pull_request trigger added. The build job runs on every PR, so a render failure blocks the merge instead of breaking production.
  • deploy is gated on github.event_name != 'pull_request'. PRs build and check; they never publish.
  • Pages credentials moved to the deploy job. pages: write / id-token: write were workflow-wide, which meant PR runs held publish permissions they had no use for.
  • Concurrency scoped per-ref (pages-${{ github.ref }}), so a PR check can't queue behind a deploy of main. Superseded PR pushes cancel themselves; deploys never do.

This extends the existing workflow rather than adding a second one. A separate PR-only workflow would duplicate the build steps, and the two would drift — the moment a setup-python step gets added for executable blog posts, a duplicated check would stop representing what actually deploys.

Two checks on the rendered output

quarto render exits 0 for plenty of broken-but-valid sites, so the render alone isn't much of a gate. Both scripts live in .github/scripts/ so they can be run locally against a _site too.

check-site.sh asserts the things that have actually gone wrong in this repo:

  • every page linked from the navbar exists
  • _site/software.html still emits its redirect stub — that comes from one aliases: line in projects.qmd, and deleting it renders fine while silently 404ing every existing link to the old Software page
  • required assets ship (cv.pdf, the figure, the profile photo)
  • cv.html hasn't regressed to raw.githubusercontent, which serves PDFs as application/octet-stream with nosniff and renders the inline embed as a blank box

check-links.py resolves every internal href/src in the rendered HTML against disk. The usual way to break a content site is a link, not a render error — a .qmd extension that should have been .html, a renamed page, an image moved out of files/. Quarto renders all of those without complaint. External URLs are not checked.

Figure removed from Projects

Figures belong on the publications page; the projects page is text-only. The SVG is unchanged and still used as the 2026 entry's thumbnail.

Verification

Rendered locally with Quarto 1.10.18 from a clean _site. Both checks pass (152 internal links across 7 pages, no breaks). I also confirmed they fail correctly — a check that can't fail is worthless — by deleting projects.html, deleting the software.html redirect, pointing cv.html back at raw.githubusercontent, and rewriting a link to ./projects.qmd. Each exits 1 with the specific reason.

The real test is this PR: build should run and deploy should be skipped.

🤖 Generated with Claude Code

https://claude.ai/code/session_011mFiYv4seQ8Hyar7anXMFR

zorian15 and others added 2 commits August 2, 2026 13:47
figures/logos are for publications only; projects page is text-only

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011mFiYv4seQ8Hyar7anXMFR
publish.yml only ran on push to main, so nothing verified a change until it
was already live.

- add pull_request trigger; deploy job gated on event_name != pull_request
- move pages:write/id-token:write to the deploy job so PR runs don't hold
  publish credentials
- concurrency scoped per-ref so PR checks don't queue behind main deploys
- check-site.sh asserts nav pages exist, the /software.html alias stub still
  emits, required assets ship, and cv.html hasn't regressed to
  raw.githubusercontent (quarto render exits 0 for all of these)
- check-links.py resolves every internal href/src against disk

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011mFiYv4seQ8Hyar7anXMFR
@zorian15
zorian15 merged commit 1a8ffe4 into main Aug 2, 2026
2 checks passed
@zorian15
zorian15 deleted the ci-render-check-on-prs branch August 2, 2026 20:51
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.

1 participant