-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (44 loc) · 1.45 KB
/
Copy pathdeploy.yml
File metadata and controls
54 lines (44 loc) · 1.45 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
name: Deploy
on:
push:
branches: [master, main]
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: '24'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test
- name: Configure KV namespace
env:
COUNTERS_KV_NAMESPACE_ID: ${{ secrets.COUNTERS_KV_NAMESPACE_ID }}
run: |
node -e "
const fs = require('fs');
const id = process.env.COUNTERS_KV_NAMESPACE_ID;
if (!id) throw new Error('COUNTERS_KV_NAMESPACE_ID secret is not set');
const file = 'wrangler.toml';
const config = fs.readFileSync(file, 'utf8').replace('YOUR_KV_NAMESPACE_ID', id);
fs.writeFileSync(file, config);
"
- name: Deploy to Cloudflare Workers
env:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
SEED_TOKEN: ${{ secrets.SEED_TOKEN }}
run: npx wrangler deploy --var "SEED_TOKEN:$SEED_TOKEN"
- name: Wait for deployment to propagate
run: sleep 10
- name: Run production durability canary
env:
COUNTER_BASE_URL: https://counter.avikalp.workers.dev
run: npm run test:production-durability