|
| 1 | +name: Fullstack deploy smoke (real providers) |
| 2 | + |
| 3 | +# #984 tier 3: deploys the Supabase × Cloudflare reference starter to a real |
| 4 | +# Cloudflare Worker and smokes the live URL. Requires maintainer-provided |
| 5 | +# secrets (see below). Manual-only: never runs on push/PR. |
| 6 | + |
| 7 | +on: |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +permissions: |
| 11 | + contents: read |
| 12 | + |
| 13 | +jobs: |
| 14 | + deploy-smoke: |
| 15 | + name: Deploy reference starter to Workers and smoke the live URL |
| 16 | + runs-on: ubuntu-latest |
| 17 | + timeout-minutes: 30 |
| 18 | + steps: |
| 19 | + # v7.0.0 |
| 20 | + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 |
| 21 | + - uses: ./.github/actions/setup-deno-workspace |
| 22 | + |
| 23 | + - name: Build the Workers bundle |
| 24 | + working-directory: examples/supabase-cloudflare-starter |
| 25 | + run: deno task nitro:build |
| 26 | + |
| 27 | + - name: Deploy to Cloudflare Workers |
| 28 | + working-directory: examples/supabase-cloudflare-starter |
| 29 | + env: |
| 30 | + CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} |
| 31 | + CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} |
| 32 | + SUPABASE_URL: ${{ secrets.SUPABASE_URL }} |
| 33 | + SUPABASE_ANON_KEY: ${{ secrets.SUPABASE_ANON_KEY }} |
| 34 | + run: >- |
| 35 | + deno run -A npm:wrangler@latest deploy .output-workers/server/index.mjs |
| 36 | + --name openelement-ref-starter |
| 37 | + --assets .output-workers/public |
| 38 | + --compatibility-date 2026-08-16 |
| 39 | + --compatibility-flags nodejs_compat |
| 40 | + --var "SUPABASE_URL:$SUPABASE_URL" "SUPABASE_ANON_KEY:$SUPABASE_ANON_KEY" |
| 41 | +
|
| 42 | + - name: Smoke the live worker |
| 43 | + env: |
| 44 | + WORKER_URL: https://openelement-ref-starter.freemanzheng.workers.dev |
| 45 | + run: | |
| 46 | + set -e |
| 47 | + for i in 1 2 3 4 5 6; do |
| 48 | + code=$(curl -s -o /dev/null -w '%{http_code}' --max-time 15 "$WORKER_URL/" || true) |
| 49 | + [ "$code" = "200" ] && break |
| 50 | + sleep 10 |
| 51 | + done |
| 52 | + echo "GET / -> $code"; [ "$code" = "200" ] |
| 53 | + notes=$(curl -s --max-time 15 "$WORKER_URL/notes") |
| 54 | + echo "$notes" | grep -q "Sign-in is required" && echo "anonymous /notes -> denied branch OK" |
| 55 | + csrf=$(curl -s -o /dev/null -w '%{http_code}' --max-time 15 -X POST "$WORKER_URL/login" -H 'Origin: https://evil.example.com' -H 'Content-Type: application/x-www-form-urlencoded' -d 'x=1') |
| 56 | + echo "cross-origin POST /login -> $csrf"; [ "$csrf" = "403" ] |
| 57 | +
|
| 58 | + - name: Write the smoke report |
| 59 | + if: always() |
| 60 | + env: |
| 61 | + WORKER_URL: https://openelement-ref-starter.freemanzheng.workers.dev |
| 62 | + run: | |
| 63 | + { |
| 64 | + echo "{" |
| 65 | + echo " \"version\": \"$(git rev-parse --short HEAD)\"," |
| 66 | + echo " \"workerUrl\": \"$WORKER_URL\"," |
| 67 | + echo " \"jobStatus\": \"${{ job.status }}\"," |
| 68 | + echo " \"note\": \"tier-3 deploy smoke; redacted — no credentials in this report\"" |
| 69 | + echo "}" |
| 70 | + } > fullstack-deploy-smoke.json |
| 71 | +
|
| 72 | + - name: Archive the smoke report |
| 73 | + if: always() |
| 74 | + # v7.0.1 |
| 75 | + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a |
| 76 | + with: |
| 77 | + name: fullstack-deploy-smoke |
| 78 | + path: fullstack-deploy-smoke.json |
| 79 | + if-no-files-found: error |
0 commit comments