From 7d633da99194c0065b0ed7b59c7e567f47ced65d Mon Sep 17 00:00:00 2001 From: Dan Marshall Date: Sat, 10 Jan 2026 11:43:08 -0800 Subject: [PATCH 1/2] Add GitHub Actions workflow for Pages PR preview --- .github/workflows/pages-preview.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/pages-preview.yml diff --git a/.github/workflows/pages-preview.yml b/.github/workflows/pages-preview.yml new file mode 100644 index 00000000..ff3c440f --- /dev/null +++ b/.github/workflows/pages-preview.yml @@ -0,0 +1,26 @@ +name: Pages PR Preview + +on: + pull_request: + branches: [ main ] + +jobs: + deploy: + runs-on: ubuntu-latest + permissions: + pages: write + id-token: write + contents: read + pull-requests: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + steps: + - uses: actions/checkout@v4 + - uses: actions/configure-pages@v5 + - uses: actions/upload-pages-artifact@v3 + with: + path: . + - uses: actions/deploy-pages@v4 + id: deployment From d50ff739553153e750e66fa8038a976ce0924152 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 30 Jun 2026 22:03:44 +0000 Subject: [PATCH 2/2] Fix Pages PR Preview workflow: skip deploy-pages on pull_request events --- .github/workflows/pages-preview.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/pages-preview.yml b/.github/workflows/pages-preview.yml index ff3c440f..a5455bef 100644 --- a/.github/workflows/pages-preview.yml +++ b/.github/workflows/pages-preview.yml @@ -1,6 +1,8 @@ name: Pages PR Preview on: + push: + branches: [ main ] pull_request: branches: [ main ] @@ -24,3 +26,15 @@ jobs: path: . - uses: actions/deploy-pages@v4 id: deployment + if: github.event_name == 'push' + - name: Comment PR with preview artifact link + if: github.event_name == 'pull_request' + uses: actions/github-script@v7 + with: + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: '📦 Pages preview artifact built. Download from the [Actions run](' + context.serverUrl + '/' + context.repo.owner + '/' + context.repo.repo + '/actions/runs/' + context.runId + ') to preview locally.' + })