From 0ea8df266dabd0f99adfb5ed09f97d72fa03a5e3 Mon Sep 17 00:00:00 2001 From: Copilot <223556219+Copilot@users.noreply.github.com> Date: Tue, 28 Jul 2026 09:19:09 -0400 Subject: [PATCH] ci: validate site builds on PRs #473 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .github/workflows/pages.yml | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index bf591332..a8039fef 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -5,6 +5,10 @@ on: branches: [main] paths: - 'site/**' + - '.github/workflows/pages.yml' + pull_request: + branches: [main] + types: [opened, synchronize, reopened, ready_for_review] workflow_run: workflows: ['Release'] types: [completed] @@ -13,6 +17,7 @@ on: permissions: contents: read pages: write + pull-requests: read id-token: write concurrency: @@ -20,8 +25,30 @@ concurrency: cancel-in-progress: false jobs: + changes: + runs-on: ubuntu-latest + name: Site change filter + outputs: + site: ${{ steps.filter.outputs.site || steps.default.outputs.site }} + steps: + - name: Check changed paths + id: filter + if: github.event_name == 'pull_request' + uses: dorny/paths-filter@v3 + with: + filters: | + site: + - 'site/**' + - '.github/workflows/pages.yml' + + - name: Mark non-PR events for build + id: default + if: github.event_name != 'pull_request' + run: echo "site=true" >> "$GITHUB_OUTPUT" + build: - if: github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' + needs: changes + if: needs.changes.outputs.site == 'true' && (github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success') runs-on: ubuntu-latest name: Build steps: @@ -42,12 +69,14 @@ jobs: run: cd site && npm run build - name: Upload artifact + if: github.event_name != 'pull_request' uses: actions/upload-pages-artifact@v5 with: path: site/dist deploy: needs: build + if: github.event_name != 'pull_request' && needs.build.result == 'success' runs-on: ubuntu-latest name: Deploy environment: