Skip to content

Update deploy.yml

Update deploy.yml #11

Workflow file for this run

name: Deploy to Cloudflare
on:
push:
branches: [ "main" ]
jobs:
worker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v2
with:
node-version: '18'
# For some reason, the default registry MAY FAIL WITH ECONNRESET on GitHub Actions
- name: Setup Registry
run: |
npm config set registry https://registry.npm.taobao.org
cd worker
npm install
npm install wrangler@3.5.1
- name: Deploy Workers
uses: cloudflare/wrangler-action@v3.1.0
with:
apiToken: ${{ secrets.API_TOKEN }}
command: deploy
workingDirectory: worker
page:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v2
with:
node-version: '18'
# For some reason, the default registry MAY FAIL WITH ECONNRESET on GitHub Actions
- name: Setup Registry
run: |
npm config set registry https://registry.npm.taobao.org
npm install
npm install wrangler@3.5.1
- name: Deploy Pages
uses: cloudflare/wrangler-action@v3.1.0
with:
apiToken: ${{ secrets.API_TOKEN }}
preCommands: |
npx @cloudflare/next-on-pages
command: pages deploy .vercel/output/static