From 70b569e25d514ca401a8522257de8a14bbf09724 Mon Sep 17 00:00:00 2001 From: emily-shen <69125074+emily-shen@users.noreply.github.com> Date: Tue, 20 Aug 2024 17:16:59 +0100 Subject: [PATCH] chore(workers-shared): Configure GitHub Actions to deploy Router Worker --- packages/workers-shared/package.json | 2 ++ packages/workers-shared/router-worker/README.md | 2 +- packages/workers-shared/router-worker/wrangler.toml | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/workers-shared/package.json b/packages/workers-shared/package.json index 9850528a427b..82372585bc7d 100644 --- a/packages/workers-shared/package.json +++ b/packages/workers-shared/package.json @@ -31,6 +31,8 @@ "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:router-worker && pnpm run deploy:asset-worker", + "deploy:router-worker": "CLOUDFLARE_API_TOKEN=$WORKERS_DEPLOY_AND_CONFIG_CLOUDFLARE_API_TOKEN wrangler versions upload --experimental-versions -c router-worker/wrangler.toml", "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" diff --git a/packages/workers-shared/router-worker/README.md b/packages/workers-shared/router-worker/README.md index b061cb4d049a..af22a292a8a3 100644 --- a/packages/workers-shared/router-worker/README.md +++ b/packages/workers-shared/router-worker/README.md @@ -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. diff --git a/packages/workers-shared/router-worker/wrangler.toml b/packages/workers-shared/router-worker/wrangler.toml index 736cb137c34a..2731d94acd45 100644 --- a/packages/workers-shared/router-worker/wrangler.toml +++ b/packages/workers-shared/router-worker/wrangler.toml @@ -8,5 +8,7 @@ # (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"