From b69ce1255e878523fbec04fa9ae33181ac02529f Mon Sep 17 00:00:00 2001 From: Prad N Date: Thu, 29 May 2025 18:15:34 -0400 Subject: [PATCH] ci: configure separate workflows for Radar and Worker deployments --- .github/workflows/deploy.yml | 39 +++++++++++++++++++++++++++++------- devbox.json | 1 + 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index ef6cd6e..043bd71 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -5,7 +5,7 @@ on: workflow_call: jobs: - wrangler: + deploy-radar: runs-on: ubuntu-latest steps: - name: Checkout @@ -24,10 +24,35 @@ jobs: enable-cache: true refresh-cli: true - - name: Deploy to Cloudflare - run: devbox run deploy - env: - CF_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} - CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} - CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + - name: Deploy Radar to Cloudflare + uses: cloudflare/wrangler-action@v3 + with: + apiToken: ${{ secrets.CF_API_TOKEN }} + accountId: ${{ secrets.CF_ACCOUNT_ID }} + workingDirectory: cmd/radar + deploy-worker: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: stable + + - name: Install devbox + uses: jetify-com/devbox-install-action@v0.13.0 + with: + enable-cache: true + refresh-cli: true + + - name: Deploy Worker to Cloudflare + uses: cloudflare/wrangler-action@v3 + with: + apiToken: ${{ secrets.CF_API_TOKEN }} + accountId: ${{ secrets.CF_ACCOUNT_ID }} + workingDirectory: cmd/worker diff --git a/devbox.json b/devbox.json index 2c70951..7bd302e 100644 --- a/devbox.json +++ b/devbox.json @@ -17,6 +17,7 @@ "export MIGRATE_ROOT=$ROOT_DIR/internal/migrations", "export RADAR_OUT=$RADAR_ROOT/build/app.wasm", "export WORKER_OUT=$WORKER_ROOT/build/app.wasm", + "go mod download", "go install github.com/syumai/workers/cmd/workers-assets-gen@latest" ], "scripts": {