forked from TBXark/ChatGPT-Telegram-Workers
-
Notifications
You must be signed in to change notification settings - Fork 3
33 lines (30 loc) · 879 Bytes
/
cloudflare.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
name: Deploy to Cloudflare Workers
on:
push:
branches: [ "test" ]
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
name: Deploy
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- run: touch wrangler.toml
- run: |
cat << 'EOF' > wrangler.toml
${{secrets.WRANGLER_TOML}}
EOF
- run: npm install
- run: CLOUDFLARE_API_TOKEN=${{ secrets.CF_API_TOKEN }} npm run wrangler publish --config=wrangler.toml > /dev/null
- name: Check CF_WORKERS_DOMAIN exists
run: |
url=${{ secrets.CF_WORKERS_DOMAIN }}
if [ -z "$url" ]; then
echo "CF_WORKERS_DOMAIL does not exist"
else
echo "CF_WORKERS_DOMAIN exists"
curl -s -o /dev/null https://$url/init
fi