Update test-and-deploy.yml #51
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}} |