Skip to content

Add GitHub Pages PR preview deployment workflow#254

Merged
kiyarose merged 4 commits into
cursor/astro-ssg-rework-280bfrom
copilot/add-gh-pages-preview-workflow
May 13, 2026
Merged

Add GitHub Pages PR preview deployment workflow#254
kiyarose merged 4 commits into
cursor/astro-ssg-rework-280bfrom
copilot/add-gh-pages-preview-workflow

Conversation

Copilot AI commented May 13, 2026

Copy link
Copy Markdown
Contributor

This adds a dedicated pre-release GitHub Pages preview pipeline for pull requests so each new PR commit can publish an updated preview deployment. The existing production Pages workflow remains unchanged.

  • What this introduces

    • New workflow: .github/workflows/github-pages-preview.yml
    • Triggered on PR lifecycle events that represent new reviewable code (opened, synchronize, reopened, ready_for_review)
    • Supports manual invocation via workflow_dispatch
  • Preview deployment behavior

    • Builds with the repo-standard Pages command: npm run build:pages
    • Uploads the dist artifact with actions/upload-pages-artifact@v3
    • Deploys with actions/deploy-pages@v4 using preview: true to target the Pages preview channel
  • Safety and CI ergonomics

    • Per-PR concurrency key to cancel stale in-flight preview deploys when newer commits arrive
    • Guard to avoid deploying previews from forked PRs (permissions/secrets-safe)
    • Minimal required permissions (contents: read, pages: write, id-token: write, pull-requests: write)
on:
  pull_request:
    branches: ["main"]
    types: [opened, synchronize, reopened, ready_for_review]

concurrency:
  group: pages-preview-${{ github.event.pull_request.number || github.ref }}
  cancel-in-progress: true

- name: Build
  run: npm run build:pages

- name: Deploy to GitHub Pages preview
  uses: actions/deploy-pages@v4
  with:
    preview: true

Copilot AI and others added 2 commits May 13, 2026 04:56
Agent-Logs-Url: https://github.com/SillyLittleTech/Portf/sessions/347cdca7-8283-4c28-ad63-8d83605460cb

Co-authored-by: kiyarose <75678535+kiyarose@users.noreply.github.com>
Agent-Logs-Url: https://github.com/SillyLittleTech/Portf/sessions/347cdca7-8283-4c28-ad63-8d83605460cb

Co-authored-by: kiyarose <75678535+kiyarose@users.noreply.github.com>

Copilot AI 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.

Pull request overview

Adds a dedicated GitHub Pages preview deployment workflow for pull requests, enabling per-commit preview publishes while leaving the existing production Pages workflow unchanged.

Changes:

  • Introduces a new PR-triggered workflow (pull_request + workflow_dispatch) to build and deploy Pages previews.
  • Adds per-PR concurrency to cancel stale in-flight preview deployments on new commits.
  • Guards deployment to avoid running preview deploys for forked PRs.

Comment thread .github/workflows/github-pages-preview.yml Outdated
Comment thread .github/workflows/github-pages-preview.yml
kiyarose and others added 2 commits May 13, 2026 01:02
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@kiyarose
kiyarose marked this pull request as ready for review May 13, 2026 05:03
@kiyarose
kiyarose merged commit 540bb27 into cursor/astro-ssg-rework-280b May 13, 2026
12 checks passed
@kiyarose
kiyarose deleted the copilot/add-gh-pages-preview-workflow branch May 13, 2026 05:04
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.

3 participants