From 20d299d1cbc9e22138e282cff15502485d3de481 Mon Sep 17 00:00:00 2001 From: LukeZ <117578407+The-LukeZ@users.noreply.github.com> Date: Sat, 8 Nov 2025 02:28:22 +0100 Subject: [PATCH 1/2] Revise Cloudflare Workers deployment guide Updated instructions for setting up Cloudflare Workers deployment with GitHub Actions, including token management and workflow configuration. --- docs/getting-started/cloudflare-workers.md | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/docs/getting-started/cloudflare-workers.md b/docs/getting-started/cloudflare-workers.md index e02a8953..36f41c9a 100644 --- a/docs/getting-started/cloudflare-workers.md +++ b/docs/getting-started/cloudflare-workers.md @@ -275,17 +275,20 @@ Before deploying code to Cloudflare via CI, you need a Cloudflare token. You can If it's a newly created token, select the **Edit Cloudflare Workers** template, if you already have another token, make sure the token has the corresponding permissions(No, token permissions are not shared between Cloudflare Pages and Cloudflare Workers). -then go to your GitHub repository settings dashboard: `Settings->Secrets and variables->Actions->Repository secrets`, and add a new secret with the name `CLOUDFLARE_API_TOKEN`. +Then go to your GitHub repository settings dashboard: `Settings->Secrets and variables->Actions->Repository secrets`, and add a new secret with the name `CLOUDFLARE_API_TOKEN`. -then create `.github/workflows/deploy.yml` in your Hono project root folder, paste the following code: +Don't forget to add your `account_id` to your `wrangler.toml` because the workflow will fail otherwise. + +Then create `.github/workflows/deploy.yml` in your Hono project root folder, paste the following code: ```yml -name: Deploy +name: Deploy to CF Workers on: push: branches: - - main + - master + workflow_dispatch: # optional for triggering manual redeploys jobs: deploy: @@ -293,6 +296,17 @@ jobs: name: Deploy steps: - uses: actions/checkout@v4 + - name: Setup pnpm # use your package manager! + uses: pnpm/action-setup@v4 + with: + version: latest + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "22" # use your node version! + cache: "pnpm" # use your package manager! + - name: Install dependencies + run: pnpm install --frozen-lockfile # use your package manager! - name: Deploy uses: cloudflare/wrangler-action@v3 with: From b57815ca828534b737b767422770b0b7637fa169 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Sat, 8 Nov 2025 04:59:19 +0000 Subject: [PATCH 2/2] ci: apply automated fixes --- docs/getting-started/cloudflare-workers.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/getting-started/cloudflare-workers.md b/docs/getting-started/cloudflare-workers.md index 36f41c9a..7d8d506f 100644 --- a/docs/getting-started/cloudflare-workers.md +++ b/docs/getting-started/cloudflare-workers.md @@ -303,8 +303,8 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: "22" # use your node version! - cache: "pnpm" # use your package manager! + node-version: '22' # use your node version! + cache: 'pnpm' # use your package manager! - name: Install dependencies run: pnpm install --frozen-lockfile # use your package manager! - name: Deploy