From 34ba622268b95bbe76a1f902fbbbb8bf832d87c5 Mon Sep 17 00:00:00 2001 From: Jason <150260202+estelledc@users.noreply.github.com> Date: Sun, 12 Jul 2026 07:50:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20Pages=20CI=EF=BC=9A?= =?UTF-8?q?=E5=90=88=E5=B9=B6=E5=89=8D=E6=89=A7=E8=A1=8C=E5=AE=8C=E6=95=B4?= =?UTF-8?q?=E6=9E=84=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Codex --- .github/workflows/pages.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 9074a7a..44c4489 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -2,17 +2,17 @@ name: Deploy GitHub Pages on: push: - branches: [main, master] + branches: [master] + pull_request: + branches: [master] workflow_dispatch: permissions: contents: read - pages: write - id-token: write concurrency: - group: "pages" - cancel-in-progress: false + group: pages-${{ github.event.pull_request.number || 'production' }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: build: @@ -27,10 +27,6 @@ jobs: ruby-version: '3.3' bundler-cache: true - - name: Setup Pages - id: pages - uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0 - - name: Check Python reference syntax run: python3 -m compileall -q final @@ -59,11 +55,15 @@ jobs: uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0 deploy: + if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/master') environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest needs: build + permissions: + pages: write + id-token: write steps: - name: Deploy to GitHub Pages id: deployment