-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (54 loc) · 1.8 KB
/
deploy.yml
File metadata and controls
65 lines (54 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Deploy
on:
workflow_dispatch:
inputs:
environment:
description: Target Cloudflare environment
required: true
type: choice
options:
- dev
- staging
- production
run_seed:
description: Run demo seed after migration
required: true
default: false
type: boolean
jobs:
deploy:
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm ci
- name: TypeScript check
run: npm run check
- name: Environment config check
run: SKIP_LOCAL_SECRET_CHECKS=true bash ./scripts/check_config.sh "${{ inputs.environment }}"
- name: Apply D1 migration
run: npm run "d1:migrate:remote:${{ inputs.environment }}"
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
- name: Optionally seed D1
if: ${{ inputs.run_seed }}
run: npm run "d1:seed:remote:${{ inputs.environment }}"
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
- name: Deploy Worker
run: npm run "deploy:${{ inputs.environment }}"
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
- name: Verify production read-only surface
if: ${{ inputs.environment == 'production' }}
run: npm run verify:production:readonly