forked from Ikalus1988/MisakaNet
-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (33 loc) 路 971 Bytes
/
Copy pathdeploy-worker.yml
File metadata and controls
39 lines (33 loc) 路 971 Bytes
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 Cloudflare Worker
on:
push:
paths:
- "workers/register-proxy-sw.js"
branches:
- main
workflow_dispatch:
permissions:
contents: read
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Deploy Worker with Wrangler
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
run: |
set -euo pipefail
cd workers
npx wrangler deploy
- name: Ensure keepalive schedule
env:
CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
run: |
set -euo pipefail
curl -fsS -X PUT \
-H "Authorization: Bearer $CF_API_TOKEN" \
-H "Content-Type: application/json" \
--data '[{"cron":"*/5 * * * *"}]' \
"https://api.cloudflare.com/client/v4/accounts/6b92325b505f2b76aec49e9fe4195d31/workers/scripts/misakanet-register-proxy/schedules"