Skip to content

Update wrangler configuration and GitHub Actions workflow #71

Update wrangler configuration and GitHub Actions workflow

Update wrangler configuration and GitHub Actions workflow #71

Workflow file for this run

name: Deploy to Cloudflare Pages
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run linting
run: npm run lint
- name: Build application
run: npm run build
- name: Temporarily move wrangler.toml to avoid Pages conflict
run: mv wrangler.toml wrangler.worker.toml
- name: Deploy to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: folio
directory: dist
wranglerVersion: '3'
- name: Restore wrangler.toml for Worker deployment
run: mv wrangler.worker.toml wrangler.toml
- name: Deploy GitHub Stats Worker
run: npx wrangler deploy --env production --config wrangler.toml
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
- name: Deploy Contact Form Worker
run: npx wrangler deploy --env production --config wrangler.contact.toml
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
continue-on-error: true