Skip to content

Migrate PR-preview workflow to Morrison-Lab/gha's preview family (preview.yml@v2 + preview-deploy.yml@v2) #102

Description

@d-morrison

Summary

.github/workflows/preview.yml builds and deploys a Quarto PR preview in a single job, using rossjrw/pr-preview-action. Morrison-Lab/gha ships this as a 4-workflow family instead: preview.yml (read-only build in the PR's own context), preview-deploy.yml (privileged deploy from a workflow_run completion, base-repo context), check-equation-renders.yml (headless-browser MathJax check on the same artifact), and cleanup-pr-previews.yml (scheduled housekeeping that removes closed PRs' preview directories — this repo's current bespoke workflow never cleans those up).

Why the build/deploy split matters here

gha's README calls this a deliberate trust boundary: untrusted fork code only runs in the read-only build half, and the privileged gh-pages push happens separately in base-repo context. This repo's current single-job preview.yml runs render and deploy together in the PR's own context, which is exactly the shape that doesn't work for fork PRs (see #90) — rossjrw/pr-preview-action's own docs already note the fork-token limitation this repo's preview.yml comment references.

What to do

  1. Read gha's README "PR previews (preview family)" section in full: it's 4 cooperating workflows and the workflow_run wiring (the deploy/equation-check stubs' workflows: value must match the build stub's name: exactly).
  2. Diff this repo's current preview.yml step-by-step against preview.yml@v2: confirm the source-dir: ./docs/ output path, tinytex: true, and the existing "listing references a missing file" render-failure check all have equivalents (or decide they're no longer needed).
  3. Install all four stubs from gha's examples/, not just the build half.
  4. Since workflow_run/schedule triggers only fire from the default-branch copy, this migration doesn't take effect until merged to main — plan the PR accordingly (a preview of the preview workflow itself won't demonstrate the new behavior).

Scope

Filed as a tracking issue only, not implementing yet. Related to #90 (fork-PR previews may specifically benefit from the trust-boundary split) but not a duplicate — that issue is about the Claude review path, this one is about the preview build/deploy path.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions