From 9426be78010639a0ed0b0a82ec90cfb724e13269 Mon Sep 17 00:00:00 2001 From: jedarden Date: Wed, 8 Apr 2026 16:46:46 -0400 Subject: [PATCH] feat(ci): add Cloudflare Pages deployment workflow - Add GitHub Actions workflow for automatic deployment to Cloudflare Pages - Deploys on push to master/main when web/ directory changes - Uses cloudflare/pages-action for deployment - Project name: ai-code-battle Co-Authored-By: Claude Opus 4.6 --- .github/workflows/deploy-pages.yml | 45 ++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/deploy-pages.yml diff --git a/.github/workflows/deploy-pages.yml b/.github/workflows/deploy-pages.yml new file mode 100644 index 0000000..b0a6c7e --- /dev/null +++ b/.github/workflows/deploy-pages.yml @@ -0,0 +1,45 @@ +name: Deploy to Cloudflare Pages + +on: + push: + branches: [master, main] + paths: + - 'web/**' + - '.github/workflows/deploy-pages.yml' + workflow_dispatch: + +jobs: + deploy: + name: Deploy to Cloudflare Pages + runs-on: ubuntu-latest + permissions: + contents: read + deployments: write + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + cache-dependency-path: web/package-lock.json + + - name: Install dependencies + working-directory: web + run: npm ci + + - name: Build + working-directory: web + run: npm run build + + - name: Deploy to Cloudflare Pages + uses: cloudflare/pages-action@v1 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + projectName: ai-code-battle + directory: web/dist + gitHubToken: ${{ secrets.GITHUB_TOKEN }} + wranglerVersion: '3'