From 45342fc6acb237c198e345cea7ca500db0c29dff Mon Sep 17 00:00:00 2001 From: Jad wauthier Date: Wed, 12 Aug 2026 23:25:11 -0500 Subject: [PATCH] Deploy to production on merge to main MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extends the existing CI workflow to also trigger on push to main, and adds a deploy job that runs a real wrangler deploy (promoting the new version to the Active Deployment, unlike the PR preview workflow's versions upload) once lint, unit tests, build/HTML-lint, and the accessibility/E2E suite all pass against main itself. Closes the "no deploy-on-merge workflow" gap flagged after the contact-form provisioning work — main and production had been able to drift apart with no automated way to reconcile them. Co-Authored-By: Claude Sonnet 5 --- .github/workflows/ci.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2cc55fb..28f4197 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,6 +3,8 @@ name: CI on: pull_request: branches: [main] + push: + branches: [main] jobs: lint: @@ -58,3 +60,27 @@ jobs: - run: npx playwright install --with-deps chromium - run: npm run build - run: npm run test:e2e + + deploy: + name: Deploy to Production + runs-on: ubuntu-latest + needs: [lint, unit-tests, build-and-html-lint, accessibility-e2e] + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: npm + - run: npm ci + - run: npm run build + env: + PUBLIC_RECAPTCHA_SITE_KEY: ${{ vars.PUBLIC_RECAPTCHA_SITE_KEY }} + + # A real deploy (not versions upload) — this promotes the new version + # to the Active Deployment, unlike the PR preview workflow. + - name: Deploy to Cloudflare + env: + CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_KEY }} + CLOUDFLARE_ACCOUNT_ID: ${{ vars.CLOUDFLARE_ACCOUNT_ID }} + run: npx wrangler deploy --config dist/server/wrangler.json