Repository navigation
61 lines (49 loc) · 1.37 KB
/
Copy pathdeploy.yml
File metadata and controls
61 lines (49 loc) · 1.37 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
name: Deploy to Cloudflare
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
# Never let two deploys race each other onto the same Workers.
concurrency:
group: deploy-cloudflare
cancel-in-progress: false
jobs:
verify:
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Set up Node environment
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: npm
- name: Install dependencies
run: npm ci
- name: Run Biome check
run: npm run check:ci
- name: Run tests
run: npm test
deploy:
runs-on: ubuntu-latest
needs: verify
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Set up Node environment
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: npm
- name: Install dependencies
run: npm ci
# `vinext-cloudflare deploy` runs the production build itself and then
# hands dist/server/wrangler.json to wrangler, which authenticates from
# these two environment variables.
- name: Build and deploy Worker
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
run: npm run deploy