-
Notifications
You must be signed in to change notification settings - Fork 209
62 lines (51 loc) · 1.7 KB
/
deploy-cloudflare-workers.yml
File metadata and controls
62 lines (51 loc) · 1.7 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
# https://github.com/marketplace/actions/deploy-to-cloudflare-workers-with-wrangler
# https://github.com/cloudflare/wrangler-action
name: Deploy to Cloudflare Workers with Wrangler
on:
push:
branches:
- master
permissions:
contents: read
concurrency:
group: cloudflare-workers-master
cancel-in-progress: true
jobs:
deploy:
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Use Node.js 24
uses: actions/setup-node@v6
with:
node-version-file: .nvmrc
cache: npm
cache-dependency-path: |
doesitarm-default/package-lock.json
workers/analytics/package-lock.json
- name: Write Wrangler configs
shell: bash
run: |
set -euo pipefail
umask 077
printf '%s' '${{ secrets.WRANGLER_ENV }}' | base64 --decode > doesitarm-default/.env
printf '%s' '${{ secrets.WRANGLER_TOML }}' | base64 --decode > doesitarm-default/wrangler.toml
printf '%s' '${{ secrets.ANALYTICS_WRANGER_TOML }}' | base64 --decode > workers/analytics/wrangler.toml
- name: Install default worker dependencies
working-directory: doesitarm-default
run: npm ci
- name: Install analytics worker dependencies
working-directory: workers/analytics
run: npm ci
- name: Deploy Default Worker
uses: cloudflare/wrangler-action@1.3.0
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
workingDirectory: 'doesitarm-default'
- name: Deploy Analytics Worker
uses: cloudflare/wrangler-action@1.3.0
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
workingDirectory: 'workers/analytics'