From b66a1126d0cbb3fbafd88b2234276ce8456ebe2f Mon Sep 17 00:00:00 2001 From: Ryan Moore Date: Tue, 14 Jul 2026 22:55:45 -0300 Subject: [PATCH] ci: auto-deploy to Cloudflare on push to main Adds a GitHub Actions workflow that builds the Astro site and deploys the ./dist Workers static assets via wrangler on every push to main. Fixes the stale-deploy gap: changes were pushed but never shipped because nothing deployed on push. Requires repo secrets CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/deploy.yml | 39 ++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..f6a9397 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,39 @@ +name: Deploy to Cloudflare + +on: + push: + branches: [main] + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: deploy-production + cancel-in-progress: true + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Node + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Build site + run: npm run build + + - name: Deploy to Cloudflare (Workers static assets) + uses: cloudflare/wrangler-action@v3 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + command: deploy