-
Notifications
You must be signed in to change notification settings - Fork 23
40 lines (37 loc) · 1.39 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
name: Deploy to Cloudflare Workers
on:
schedule:
- cron: "30 10 * * 2"
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- run: npm install
- run: ./import-geoip.sh
env:
MAXMIND_ACCOUNT_ID : ${{ secrets.MAXMIND_ACCOUNT_ID }}
MAXMIND_LICENSE_KEY : ${{ secrets.MAXMIND_LICENSE_KEY }}
CLOUDFLARE_ACCOUNT_ID : ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN : ${{ secrets.CLOUDFLARE_API_TOKEN }}
UPSTREAM_ENDPOINT : ${{ secrets.UPSTREAM_ENDPOINT }}
- run: mv tmp/wrangler.toml .
- run: npm run deploy
env:
CLOUDFLARE_ACCOUNT_ID : ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN : ${{ secrets.CLOUDFLARE_API_TOKEN }}
- name: Update release
run: |
mkdir release && cd release
DATE=`date`
echo $DATE >release
git init
git config --local user.name "github-actions[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git checkout -b release
git add -A
git commit -m "$DATE"
git remote add origin "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}"
git push -f -u origin release