-
Notifications
You must be signed in to change notification settings - Fork 103
40 lines (33 loc) · 1.11 KB
/
main.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
name: Deploy to Cloudflare Workers
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
name: Deploy
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '20.x'
- name: Install dependencies
run: npm install
- name: Generate wrangler.toml
run: |
sed -e 's/$USERNAME/${{ secrets.USERNAME || '"'"'default_username'"'"' }}/g' \
-e 's/$PASSWORD/${{ secrets.PASSWORD || '"'"'default_password'"'"' }}/g' \
-e 's/$BUCKET_NAME/${{ secrets.BUCKET_NAME || '"'"'default_bucket_name'"'"' }}/g' \
wrangler.toml.template > wrangler.toml
cat wrangler.toml
- name: Publish to Cloudflare Workers
uses: cloudflare/[email protected]
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
- name: Debug Info
run: |
echo "Node version: $(node -v)"
echo "NPM version: $(npm -v)"
echo "Wrangler version: $(npx wrangler --version)"