Skip to content

Use wrangler deploy command #18

Use wrangler deploy command

Use wrangler deploy command #18

Workflow file for this run

name: "CI/CD"
on:
push:
branches:
- main
- dev
paths-ignore:
- "*.md"
pull_request:
jobs:
ci:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x, 22.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- run: npm ci
- run: npm test
deploy:
needs: ci
name: Deploy
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Publish Dev
if: endsWith(github.ref, '/dev')
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
command: deploy --env=dev
- name: Publish Prod
if: endsWith(github.ref, '/main')
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
command: deploy