-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (75 loc) · 2.4 KB
/
Copy pathdeploy.yml
File metadata and controls
77 lines (75 loc) · 2.4 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
66
67
68
69
70
71
72
73
74
75
76
77
name: Verify and Deploy Workers
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
concurrency:
group: deploy-workers-${{ github.ref }}
cancel-in-progress: true
jobs:
verify:
name: Verify workers
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: '22'
cache: npm
- run: npm ci
- run: npm run lint
- run: npm run validate:json
- run: npm test
- run: npm run test:permit-poller
- run: npm run test:workers
- run: npm run validate:registry
- run: npm run wrangler:dry-run
- run: npm run wrangler:dry-run:permit-poller
- run: git diff --check
deploy-tool-registry:
name: Deploy tool-registry Worker
if: github.event_name != 'pull_request'
needs: verify
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: '22'
cache: npm
- run: npm ci
- name: Deploy tool-registry only
uses: cloudflare/wrangler-action@v4
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
wranglerVersion: '4'
command: deploy --config tool-registry/wrangler.jsonc
- name: Allow Cloudflare deployment propagation
run: sleep 25
- name: Run live acceptance harness
run: node scripts/live-acceptance.mjs
deploy-permit-poller:
name: Provision and deploy permit poller
if: github.event_name != 'pull_request'
needs: verify
runs-on: ubuntu-latest
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
TWILIO_ACCOUNT_SID: ${{ secrets.TWILIO_ACCOUNT_SID }}
TWILIO_AUTH_TOKEN: ${{ secrets.TWILIO_AUTH_TOKEN }}
TWILIO_FROM_NUMBER: ${{ secrets.TWILIO_FROM_NUMBER }}
TWILIO_VERIFY_SERVICE_SID: ${{ secrets.TWILIO_VERIFY_SERVICE_SID }}
TURNSTILE_SECRET_KEY: ${{ secrets.TURNSTILE_SECRET_KEY }}
TURNSTILE_SITE_KEY: ${{ vars.TURNSTILE_SITE_KEY }}
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: '22'
cache: npm
- run: npm ci
- name: Provision resources, migrate D1, and deploy
run: npm run deploy:permit-poller