From 7c8a548798fe848cbef4073bc6bc512d564bed1b Mon Sep 17 00:00:00 2001 From: Hunter Date: Sat, 28 Feb 2026 17:59:19 -0500 Subject: [PATCH] feat: add cloud frontend build dispatch workflow (#9308) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Adds `.github/workflows/cloud-dispatch-build.yaml` — fires a `repository_dispatch` event (`frontend-asset-build`) to `Comfy-Org/cloud` on push to `cloud/*` branches and `main`. The cloud repo handles the actual build, GCS upload, and secret management (Sentry, Algolia, GCS creds). This is fire-and-forget. ## Changes - New workflow: `cloud-dispatch-build.yaml` - Trigger: `push` to `cloud/*` and `main` only - Payload: `ref` (commit SHA) + `branch` (branch name), built with `jq` to prevent injection - SHA-pinned `peter-evans/repository-dispatch@v4.0.1` - Hardened: `permissions: {}`, fork guard (`if: github.repository == 'Comfy-Org/ComfyUI_frontend'`), concurrency to avoid dispatch storms - `cloud-deploy-frontend.yaml` left unchanged (still needed during migration) ## Setup Required A repository secret `CLOUD_DISPATCH_TOKEN` must be configured — see PR description comments. ## Part of Frontend separate deploy prep (Task 1.3) ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-9308-feat-add-cloud-frontend-build-dispatch-workflow-3156d73d36508164a515eb968f6c5d79) by [Unito](https://www.unito.io) --- .github/workflows/cloud-dispatch-build.yaml | 45 +++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/cloud-dispatch-build.yaml diff --git a/.github/workflows/cloud-dispatch-build.yaml b/.github/workflows/cloud-dispatch-build.yaml new file mode 100644 index 0000000000..aed9efa965 --- /dev/null +++ b/.github/workflows/cloud-dispatch-build.yaml @@ -0,0 +1,45 @@ +--- +# Dispatches a frontend-asset-build event to the cloud repo on push to +# cloud/* branches and main. The cloud repo handles the actual build, +# GCS upload, and secret management (Sentry, Algolia, GCS creds). +# +# This is fire-and-forget — it does NOT wait for the cloud workflow to +# complete. Status is visible in the cloud repo's Actions tab. + +name: Cloud Frontend Build Dispatch + +on: + push: + branches: + - 'cloud/*' + - 'main' + workflow_dispatch: + +permissions: {} + +concurrency: + group: cloud-dispatch-${{ github.ref }} + cancel-in-progress: true + +jobs: + dispatch: + # Fork guard: prevent forks from dispatching to the cloud repo + if: github.repository == 'Comfy-Org/ComfyUI_frontend' + runs-on: ubuntu-latest + steps: + - name: Build client payload + id: payload + run: | + payload="$(jq -nc \ + --arg ref "${GITHUB_SHA}" \ + --arg branch "${GITHUB_REF_NAME}" \ + '{ref: $ref, branch: $branch}')" + echo "json=${payload}" >> "${GITHUB_OUTPUT}" + + - name: Dispatch to cloud repo + uses: peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697 # v4.0.1 + with: + token: ${{ secrets.CLOUD_DISPATCH_TOKEN }} + repository: Comfy-Org/cloud + event-type: frontend-asset-build + client-payload: ${{ steps.payload.outputs.json }}