Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure GitHub Actions to deploy Router Worker #6543

Merged
merged 2 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions packages/workers-shared/asset-worker/wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,18 @@ account_id = "0f1b8aa119a907021f659042f95ea9ba"
workers_dev = false
main = "src/index.ts"
compatibility_date = "2024-07-31"
compatibility_flags = ["nodejs_compat"]

[[unsafe.bindings]]
name = "ASSETS_MANIFEST"
type = "param"
param = "assetManifest"
data_ref = true

[[unsafe.bindings]]
name = "ASSETS_KV_NAMESPACE"
type = "internal_assets"

[unsafe.metadata.build_options]
stable_id = "cloudflare/cf_asset_worker"
networks = ["cf","jdc"]
3 changes: 2 additions & 1 deletion packages/workers-shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@
"check:type": "pnpm run check:type:tests && tsc",
"check:type:tests": "tsc -p ./asset-worker/tests/tsconfig.json",
"clean": "rimraf dist",
"deploy": "pnpm run deploy:asset-worker",
"deploy": "pnpm run deploy:router-worker && pnpm run deploy:asset-worker",
CarmenPopoviciu marked this conversation as resolved.
Show resolved Hide resolved
"deploy:asset-worker": "CLOUDFLARE_API_TOKEN=$WORKERS_NEW_CLOUDFLARE_API_TOKEN wrangler versions upload --experimental-versions -c asset-worker/wrangler.toml",
"deploy:router-worker": "CLOUDFLARE_API_TOKEN=$WORKERS_DEPLOY_AND_CONFIG_CLOUDFLARE_API_TOKEN wrangler versions upload --experimental-versions -c router-worker/wrangler.toml",
CarmenPopoviciu marked this conversation as resolved.
Show resolved Hide resolved
"dev": "pnpm run clean && concurrently -n bundle:asset-worker,bundle:router-worker -c blue,magenta \"pnpm run bundle:asset-worker --watch\" \"pnpm run bundle:router-worker --watch\"",
"test": "vitest",
"test:ci": "pnpm run test run"
Expand Down
2 changes: 1 addition & 1 deletion packages/workers-shared/router-worker/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# `router-worker`

The Router Worker is a [Cloudflare Worker](https://developers.cloudflare.com/workers/) that is responsible for routing between a user worker and static assets in a Workers + Assets project.
The Router Worker is a [Cloudflare Worker](https://developers.cloudflare.com/workers/) that is responsible for routing between a user Worker and static assets in a Workers + Assets project.
15 changes: 15 additions & 0 deletions packages/workers-shared/router-worker/wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,20 @@
# (see packages/wrangler/src/dev/miniflare.ts -> buildMiniflareOptions())
##
name = "router-worker"
account_id = "0f1b8aa119a907021f659042f95ea9ba"
workers_dev = false
main = "src/index.ts"
compatibility_date = "2024-07-31"

[[unsafe.bindings]]
name = "ASSET_WORKER"
type = "internal_assets"
fetcherApi = "fetcher"

[[unsafe.bindings]]
name = "USER_WORKER"
type = "origin"

[unsafe.metadata.build_options]
stable_id = "cloudflare/cf_router_worker"
networks = ["cf","jdc"]
Loading