Skip to content

chore: publish HTML previews of PRs to GitHub Pages - #15

Merged
jogu merged 1 commit into
mainfrom
jogu/pr-previews
Jul 23, 2026
Merged

chore: publish HTML previews of PRs to GitHub Pages#15
jogu merged 1 commit into
mainfrom
jogu/pr-previews

Conversation

@jogu

@jogu jogu commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Adds IETF-style HTML previews for pull requests, following the model used in openid/publication (and IETF repos such as oauth-wg/oauth-first-party-apps):

  • The site moves from actions/deploy-pages to a gh-pages branch: main's Editor's Copy is published at the branch root, and each PR's rendered HTML is pushed to PREVIEW-DO-NOT-USE/pr-<N>/.
  • The existing build job's site artifact is reused for the preview, so the spec is only rendered once per run.
  • A sticky PR comment links directly to the preview HTML and is updated in place on every push.
  • A new preview-cleanup.yml workflow deletes the preview directory when the PR is closed or merged.
  • Fork PRs are skipped (their GITHUB_TOKEN is read-only), matching the usual limitation of this approach.

The repo's Pages source has already been switched to the gh-pages branch, and the branch root was seeded with the current main Editor's Copy, so https://openid.github.io/dchp/ continues to serve and the preview comment below works now (see it in action on this PR). One consequence: until this PR merges, a push to main would fail in the old publish-to-pages job (actions/deploy-pages no longer matches the Pages configuration) — merging this fixes that.

🤖 Generated with Claude Code

github-actions Bot pushed a commit that referenced this pull request Jul 20, 2026
@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown

📄 Editor's Copy preview

https://openid.github.io/dchp/PREVIEW-DO-NOT-USE/pr-15/digital-credentials-harmonized-presentation-editors-copy.html

Preview of 6860f8a; updated on every push. For review only — the official specifications are published at https://openid.net/specs/

@openid openid deleted a comment from github-actions Bot Jul 20, 2026
Serve the site from a gh-pages branch instead of actions/deploy-pages:
main's Editor's Copy at the root, and each PR's rendered HTML under
PREVIEW-DO-NOT-USE/pr-<N>/, linked from a sticky PR comment and removed
when the PR closes. Same model as the openid/publication repo. Fork PRs
get no preview (read-only token).

The checkout-or-create, commit-if-changed, retry-push sequence is shared
by all three jobs via tools/publish-gh-pages.sh. gh-pages is fetched
shallow (it grows a site snapshot per publish) with an explicit refspec
(actions/checkout configures only the triggering ref, so a bare fetch
would give checkout nothing to resolve gh-pages against). The sticky
comment is matched on a hidden HTML marker rather than its visible
heading, and the preview URL is derived from the repo context.

The repo's Pages source has already been switched to the gh-pages
branch, seeded with main's current Editor's Copy.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jogu
jogu force-pushed the jogu/pr-previews branch from ea96fbd to 6860f8a Compare July 21, 2026 15:09
github-actions Bot pushed a commit that referenced this pull request Jul 21, 2026

@awoie awoie 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.

lgtm

@jogu
jogu merged commit a019fe8 into main Jul 23, 2026
6 checks passed
github-actions Bot pushed a commit that referenced this pull request Jul 23, 2026
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