-
Notifications
You must be signed in to change notification settings - Fork 14
59 lines (55 loc) · 1.71 KB
/
deploy.yml
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
name: Deploy to Cloudflare workers
run-name: Deploy "${{ inputs.worker }}-${{ inputs.environment }}" by @${{ github.actor }}
on:
workflow_dispatch:
inputs:
worker:
description: 'Name of the worker'
required: true
type: choice
options: # please add manually if you add new worker
- capture
- counter
- durable-jpeg
- frame
- image
- keywise
- newsletter
- party
- polysearch
- price
- scheduled
- ssr-opengraph
environment:
description: 'Choose an environment'
required: true
type: choice
default: 'beta'
options:
- default
- beta
- production
jobs:
deploy:
runs-on: ubuntu-latest
name: Deploy
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- name: Publish (beta or production)
if: github.event.inputs.environment == 'beta' || github.event.inputs.environment == 'production'
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
workingDirectory: ./services/${{ github.event.inputs.worker }}
command: publish --env ${{ github.event.inputs.environment }}
packageManager: pnpm
- name: Publish (default)
if: github.event.inputs.environment != 'beta' && github.event.inputs.environment != 'production'
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
workingDirectory: ./services/${{ github.event.inputs.worker }}
packageManager: pnpm