-
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (47 loc) · 1.5 KB
/
Copy pathdeploy-worker.yml
File metadata and controls
56 lines (47 loc) · 1.5 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
name: Deploy worker
on:
push:
branches: [master]
paths: [worker/**, js/**, .github/workflows/deploy-worker.yml]
release:
types: [published]
workflow_dispatch:
concurrency:
group: deploy-worker
cancel-in-progress: false
jobs:
worker:
runs-on: ubuntu-latest
environment: cloudflare
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
steps:
- uses: actions/checkout@v5
- name: Fill in the namespace and the route
working-directory: worker
run: |
sed -i "s/KV_NAMESPACE_ID/${{ secrets.KV_NAMESPACE_ID }}/" wrangler.toml
sed -i "s/ZONE_ID/${{ secrets.ZONE_ID }}/" wrangler.toml
sed -i "s|WORKER_ROUTE|${{ vars.WORKER_ROUTE }}|" wrangler.toml
- uses: actions/setup-node@v5
with:
node-version: 24
- name: Build the reader
working-directory: js
run: npm ci && npm run build
- name: Install the worker
working-directory: worker
run: npm ci
- name: Put the newest database in KV
if: github.event_name != 'push'
env:
GH_TOKEN: ${{ github.token }}
working-directory: worker
run: |
gh release download --pattern plevin.plv --output plevin.plv
npx wrangler kv key put --binding PLEVIN --remote plevin.plv \
--path plevin.plv
- name: Deploy
working-directory: worker
run: npx wrangler deploy