-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (46 loc) · 1.4 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
name: Deploy
on:
workflow_dispatch:
push:
branches:
- master
repository_dispatch:
schedule:
- cron: '0 0 1 * *'
jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v1
with:
node-version: '12'
- run: apt-fast update && apt-fast install -y jq
- run: yarn install
- run: yarn build
- name: Publish
uses: cloudflare/[email protected]
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
preCommands: |
export KV_NAMESPACE_ID=$(npx @cloudflare/wrangler@1 kv:namespace list 2> >(tee stderr.log >&2) | head -1 | node -pe "JSON.parse(fs.readFileSync('/dev/stdin').toString()).find(kv => kv.title.includes('KV_STATUS_PAGE')).id")
postCommands: |
env:
CF_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}
timestamp:
runs-on: ubuntu-latest
needs: deploy
steps:
- uses: actions/checkout@v3
- name: Timestamp
shell: bash
run: |
date >> ./timestamp
zone=$(TZ='Europe/Bratislava' date -r ./timestamp)
sed -i "11s/.*/$zone/" ./.github/README.md
git config --global user.email ${{ secrets.EMAIL }}
git config --global user.name ${{ secrets.NAME }}
git add ./.github/README.md
git commit -m "timestamp" ./.github/README.md
git push --force