@@ -10,51 +10,17 @@ jobs:
1010 deploy :
1111 runs-on : ubuntu-latest
1212 permissions :
13- contents : write
13+ id-token : write
14+ contents : read
1415
1516 steps :
1617 - uses : actions/checkout@v4
1718
18- - name : Install Deno
19- uses : denoland/setup-deno@v2
20- with :
21- deno-version : v2.x
22-
2319 - name : Deploy to Deno Deploy
20+ uses : denoland/deployctl@v1
21+ with :
22+ project : screenoperator-kilo-proxy
23+ entrypoint : cloudflare-worker/kilo-proxy/kilo_proxy.ts
24+ root : .
2425 env :
2526 DENO_DEPLOY_TOKEN : ${{ secrets.DENO_DEPLOY_TOKEN }}
26- run : |
27- set -e
28-
29- # Create project (ignore error if name taken)
30- curl -s -X POST "https://api.deno.com/v1/projects" \
31- -H "Authorization: Bearer $DENO_DEPLOY_TOKEN" \
32- -H "Content-Type: application/json" \
33- -d '{"name":"screenoperator-kilo-proxy"}' || true
34-
35- # Deploy
36- deno run -A jsr:@deno/deployctl deploy \
37- --project=screenoperator-kilo-proxy \
38- --token="$DENO_DEPLOY_TOKEN" \
39- --no-static \
40- cloudflare-worker/kilo-proxy/kilo_proxy.ts
41-
42- # Get domain and write to file
43- sleep 2
44- INFO=$(curl -s "https://api.deno.com/v1/projects/screenoperator-kilo-proxy" \
45- -H "Authorization: Bearer $DENO_DEPLOY_TOKEN")
46- DOMAIN=$(echo "$INFO" | python3 -c "
47- import sys,json
48- try :
49- p=json.load(sys.stdin)
50- d=[x.get('domain','') for x in p.get('domains',[])]
51- print(next((x for x in d if 'deno.dev' in x),'screenoperator-kilo-proxy.deno.dev'))
52- except : print('screenoperator-kilo-proxy.deno.dev')
53- " )
54- echo " Proxy URL: https://$DOMAIN"
55- echo "https://$DOMAIN" > cloudflare-worker/kilo-proxy/PROXY_URL.txt
56- git config user.name "github-actions[bot]"
57- git config user.email "github-actions[bot]@users.noreply.github.com"
58- git add cloudflare-worker/kilo-proxy/PROXY_URL.txt
59- git diff --staged --quiet || git commit -m "chore : save proxy URL [skip ci]"
60- git push || true
0 commit comments