Skip to content

Add GitHub Pages PR previews (migrate main deploy to gh-pages branch)#3

Merged
zaynelt merged 1 commit into
mainfrom
zt/pages-pr-previews
Jun 26, 2026
Merged

Add GitHub Pages PR previews (migrate main deploy to gh-pages branch)#3
zaynelt merged 1 commit into
mainfrom
zt/pages-pr-previews

Conversation

@zaynelt

@zaynelt zaynelt commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

What

  • Reworks the main deploy (pages.yml) to publish the built _site to the root of a gh-pages branch (keep_files: true so it never wipes preview subdirs).
  • Adds pr-preview.yml: every PR builds and publishes to /labs/pr-preview/pr-N/, auto-comments the preview URL, and tears the preview down on close/merge.

Why

Lets stakeholders without repo access review branch content (copy, style) via a plain public URL — no clone, no GitHub account needed (repo is public).

Cutover (zero downtime)

  1. Merge this PR → pages.yml runs and seeds gh-pages root with the full live site.
  2. Flip the Pages source to the now-populated gh-pages branch:
    echo '{"build_type":"legacy","source":{"branch":"gh-pages","path":"/"}}' | gh api --method PUT repos/workato-devs/labs/pages --input -
    
    The switch is instant since gh-pages already holds the complete site. The public URL (workato-devs.github.io/labs/) is unchanged.

Rollback: flip the source back with "build_type":"workflow".

Note: opening this PR triggers pr-preview.yml for the first time (creates gh-pages + a preview of this PR). The preview URL only resolves after the source flip above.

🤖 Generated with Claude Code

Rework main deploy to publish built _site to the gh-pages branch root
(keep_files preserves preview subdirs), and add a PR Preview workflow
that publishes each PR to /labs/pr-preview/pr-N/ and comments the URL.
Lets stakeholders without repo access review branches via a plain URL
@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-06-26 00:05 UTC

@zaynelt zaynelt merged commit 6c7ebcf into main Jun 26, 2026
8 checks passed
@zaynelt zaynelt deleted the zt/pages-pr-previews branch June 26, 2026 00:05
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