Skip to content

Create deploy.yml

Create deploy.yml #2

Workflow file for this run

name: Deploy to Cloudflare
on:
push:
branches:
- main
- test
jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install Wrangler
run: npm add -g wrangler
- name: Install Next
run: npm add -g next
- name: Install dependencies
run: npm install
- name: Repair cloudflare-nextjs
run: npm uninstall cloudflare-nextjs
- name: Repair cloudflare-nextjs
run: npm install @cloudflare/next-on-pages
- name: Build
run: npm run pages:build
- name: Deploy to Cloudflare Pages
run: wrangler pages deploy --branch=main
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}