Skip to content

Update test-and-deploy.yml #51

Update test-and-deploy.yml

Update test-and-deploy.yml #51

name: Deploy Prod
on:
push:
branches:
- master
env:
WORKER_ENV: prod
RUN: ${{github.run_id}}-${{github.run_number}}-${{github.run_attempt}}
jobs:
pre-deploy:
runs-on: ubuntu-latest
name: Pre Deploy
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run pre-deploy
run: npm run pre-deploy
- name: Run TypeScript error checking
run: npm run ts-errcheck
- name: Run tests
run: npm test
deploy:
needs: pre-deploy
runs-on: ubuntu-latest
environment: prod
name: Deploy
steps:
- uses: actions/checkout@v4
- name: Deploy
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{secrets.CLOUDFLARE_API_TOKEN}}
environment: ${{env.WORKER_ENV}}