-
-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (45 loc) · 1.6 KB
/
Copy pathdeploy-release.yml
File metadata and controls
53 lines (45 loc) · 1.6 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
name: Deploy release to Cloudflare Workers
# Production deploys are gated on release-please tags. Cloudflare Workers
# Builds' Git integration only watches branches, so instead of letting it
# auto-deploy main we build here and ship with `wrangler deploy` whenever
# release-please cuts a `v*` tag (i.e. when its release PR is merged).
#
# Prerequisites (one-time, see PR description):
# - Disable / pause the Workers Builds Git integration so it does not
# also deploy on every push to main.
# - Add repo secrets CLOUDFLARE_API_TOKEN (Workers Scripts:Edit + the
# account's D1 scope) and CLOUDFLARE_ACCOUNT_ID.
on:
push:
tags:
- 'v*'
concurrency:
group: deploy-release
cancel-in-progress: false
jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build (cloudflare_module preset)
run: pnpm build
env:
NODE_ENV: production
# Nitro's cloudflare_module preset with deployConfig:true writes
# wrangler.json plus the worker entry into .output/, so wrangler
# deploy runs from there with no extra flags.
- name: Deploy with Wrangler
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: deploy
workingDirectory: .output