From 6c39eae81590c2b8ed4b13b7a8bec1a406ef7fe8 Mon Sep 17 00:00:00 2001 From: Xi Xu Date: Tue, 18 Nov 2025 20:57:01 +0800 Subject: [PATCH] Update deployment workflows to trigger on workflow_run Changed Cloudflare Pages and EdgeOne Pages workflows to trigger on successful completion of the 'Sync to Pages' workflow for the main branch, instead of on push to pages branch. Also updated permissions and job names for clarity and consistency. --- .github/workflows/pages-cf.yml | 8 ++++++-- .github/workflows/pages-eo.yml | 9 +++++++-- .github/workflows/workers.yml | 2 +- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pages-cf.yml b/.github/workflows/pages-cf.yml index e634f85..205d1aa 100644 --- a/.github/workflows/pages-cf.yml +++ b/.github/workflows/pages-cf.yml @@ -1,9 +1,12 @@ name: Deploy to Cloudflare Pages on: - push: + workflow_run: + workflows: ["Sync to Pages"] + types: + - completed branches: - - pages + - main workflow_dispatch: concurrency: @@ -17,6 +20,7 @@ jobs: permissions: contents: read deployments: write + if: ${{ github.event.workflow_run.conclusion == 'success' }} steps: - name: Checkout pages branch diff --git a/.github/workflows/pages-eo.yml b/.github/workflows/pages-eo.yml index 7d6f31e..9115dd2 100644 --- a/.github/workflows/pages-eo.yml +++ b/.github/workflows/pages-eo.yml @@ -1,9 +1,12 @@ name: Deploy to EdgeOne Pages on: - push: + workflow_run: + workflows: ["Sync to Pages"] + types: + - completed branches: - - pages + - main workflow_dispatch: concurrency: @@ -16,6 +19,8 @@ jobs: timeout-minutes: 15 permissions: contents: read + deployments: write + if: ${{ github.event.workflow_run.conclusion == 'success' }} steps: - name: Checkout pages branch diff --git a/.github/workflows/workers.yml b/.github/workflows/workers.yml index 90ae293..5939b35 100644 --- a/.github/workflows/workers.yml +++ b/.github/workflows/workers.yml @@ -1,4 +1,4 @@ -name: Deploy Worker +name: Deploy to Cloudflare Workers on: push: