Skip to content

Commit 1e84667

Browse files
Update publish-production.yml
1 parent 11bb2d7 commit 1e84667

File tree

1 file changed

+18
-39
lines changed

1 file changed

+18
-39
lines changed
Lines changed: 18 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,19 @@
1-
name: Publish
2-
on:
3-
push:
4-
branches:
5-
- production
1+
# Top-level configuration
2+
name = "my-worker"
3+
main = "src/index.js"
4+
compatibility_date = "2022-07-12"
65

7-
jobs:
8-
publish:
9-
name: Production
10-
runs-on: ubuntu-22.04
11-
permissions:
12-
contents: read
13-
steps:
14-
- uses: actions/checkout@v4
15-
with:
16-
fetch-depth: 0
17-
- uses: actions/setup-node@v4
18-
with:
19-
node-version: 22.x
20-
cache: npm
21-
- run: npm ci
22-
- uses: actions/cache/restore@v4
23-
with:
24-
path: |
25-
node_modules/.astro/assets
26-
key: static
27-
- run: npm run build
28-
name: Build
29-
env:
30-
NODE_OPTIONS: --max-old-space-size=4096
31-
- run: npx wrangler deploy
32-
name: Deploy to Cloudflare Workers
33-
env:
34-
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
35-
- uses: actions/cache/save@v4
36-
if: always()
37-
with:
38-
path: |
39-
node_modules/.astro/assets
40-
key: static
6+
workers_dev = false
7+
route = { pattern = "example.org/*", zone_name = "example.org" }
8+
9+
kv_namespaces = [
10+
{ binding = "<MY_NAMESPACE>", id = "<KV_ID>" }
11+
]
12+
13+
[env.staging]
14+
name = "my-worker-staging"
15+
route = { pattern = "staging.example.org/*", zone_name = "example.org" }
16+
17+
kv_namespaces = [
18+
{ binding = "<MY_NAMESPACE>", id = "<STAGING_KV_ID>" }
19+
]

0 commit comments

Comments
 (0)