-
-
Notifications
You must be signed in to change notification settings - Fork 8
40 lines (38 loc) · 1.2 KB
/
deployPoller.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
name: Deploy Poller
on:
push:
branches:
- main
paths:
- "poller/**"
- ".github/workflows/deployPoller.yml"
repository_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: 18
- run: yarn install
- run: yarn build
working-directory: poller
- name: Publish
uses: cloudflare/[email protected]
with:
workingDirectory: poller
apiToken: ${{ secrets.CF_API_TOKEN }}
preCommands: |
wrangler kv:namespace create KV_STATUS_PAGE || true
apt-get update && apt-get install -y jq
export KV_NAMESPACE_ID=$(wrangler kv:namespace list | jq -c 'map(select(.title | contains("KV_STATUS_PAGE")))' | jq -r ".[0].id")
echo "[env.production]" >> wrangler.toml
echo "kv_namespaces = [{binding=\"KV_STATUS_PAGE\", id=\"${KV_NAMESPACE_ID}\"}]" >> wrangler.toml
postCommands: |
yarn kv-gc
environment: production
env:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}
YARN_IGNORE_NODE: 1