Skip to content

Commit 8eb59ca

Browse files
committed
build(starlight): service-bind docs worker instead of path route
Cloudflare rejects path-prefixed routes (e.g. inertiacore.net/docs/*) for Workers with [assets] — they can only bind host-only routes. The docs worker drops its route block entirely and is reached via a service binding from the inertiacore.net frontdoor worker, which holds the host-level route and forwards /docs/* requests through. - Remove the "Inject Cloudflare route" step from the deploy workflow since the docs worker no longer needs CF_ROUTE_PATTERN / CF_ZONE_NAME. - Update wrangler.toml with a comment explaining the service-binding model and pointing at the splash repo's frontdoor worker config. - Pin wrangler ^4 so cloudflare/wrangler-action@v3 picks up the project version instead of falling back to its bundled v3.90.
1 parent 8d9e8b2 commit 8eb59ca

4 files changed

Lines changed: 538 additions & 35 deletions

File tree

.github/workflows/deploy-starlight.yml

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -58,32 +58,14 @@ jobs:
5858
working-directory: starlight
5959
run: pnpm build
6060

61-
- name: Inject Cloudflare route into wrangler.toml
62-
# wrangler.toml ships without a [[routes]] block because wrangler
63-
# doesn't interpolate env vars there. Append one from repo vars
64-
# so the same file works for local *.workers.dev deploys and for
65-
# zone-bound CI deploys without a code change.
66-
if: vars.CF_ROUTE_PATTERN != '' && vars.CF_ZONE_NAME != ''
67-
working-directory: starlight
68-
env:
69-
CF_ROUTE_PATTERN: ${{ vars.CF_ROUTE_PATTERN }}
70-
CF_ZONE_NAME: ${{ vars.CF_ZONE_NAME }}
71-
run: |
72-
{
73-
echo ""
74-
echo "[[routes]]"
75-
echo "pattern = \"${CF_ROUTE_PATTERN}\""
76-
echo "zone_name = \"${CF_ZONE_NAME}\""
77-
} >> wrangler.toml
78-
echo "--- wrangler.toml route block ---"
79-
tail -4 wrangler.toml
80-
8161
- name: Deploy to Cloudflare Workers
8262
uses: cloudflare/wrangler-action@v3
8363
with:
8464
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
8565
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
8666
workingDirectory: starlight
87-
# wrangler reads ./wrangler.toml from workingDirectory and uses
88-
# the [assets] block to upload ./dist.
67+
# The docs Worker has no zone route — it's invoked via service
68+
# binding from the inertiacore.net frontdoor worker. wrangler
69+
# reads ./wrangler.toml and uploads ./dist via the [assets]
70+
# block, no route negotiation needed.
8971
command: deploy

starlight/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
},
2525
"devDependencies": {
2626
"acorn": "^8.16.0",
27-
"unist-util-visit": "^5.1.0"
27+
"unist-util-visit": "^5.1.0",
28+
"wrangler": "^4.81.1"
2829
}
2930
}

0 commit comments

Comments
 (0)