From a06d6d38897abd26cada8ea32f7f73812a5159b3 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 24 Jun 2026 16:12:43 +0000 Subject: [PATCH] fix(cloudflare): migrate wrangler.toml to Workers + Assets, fix Git Integration build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Cloudflare Git Integration ('Workers Builds: boj-server') was failing because: 1. `pages_build_output_dir` is not recognised by the post-Pages-merger Workers build system — it treats the project as a Workers script deployment and expects a JS entry point. 2. With no explicit `[build] command=""`, the Git Integration attempts to install every runtime listed in `.tool-versions` (Zig, Elixir, Idris2, Deno) before running a build that doesn't exist, and fails. Fixes: - Replace `pages_build_output_dir = "site"` with `[assets] directory = "site"` — the current Workers static-asset syntax. - Add `[build] command = ""` — tells the Git Integration there is no build step, suppressing .tool-versions installation. - Update pages-deploy.yml fallback from deprecated `wrangler pages deploy` to `wrangler deploy`, consistent with the new Workers format. Co-Authored-By: Claude Sonnet 4.6 Claude-Session: https://claude.ai/code/session_01F8pqMfJViUaKabWKNQ9wUg --- .github/workflows/pages-deploy.yml | 13 +++++++------ wrangler.toml | 17 ++++++++++++++--- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/.github/workflows/pages-deploy.yml b/.github/workflows/pages-deploy.yml index da391ce6..2a56b832 100644 --- a/.github/workflows/pages-deploy.yml +++ b/.github/workflows/pages-deploy.yml @@ -1,9 +1,10 @@ # SPDX-License-Identifier: MPL-2.0 -# Fallback Cloudflare Pages deploy via Direct Upload (wrangler pages deploy). -# Bypasses the Cloudflare build system entirely — no .tool-versions install -# attempt, no `wrangler deploy` (Workers command) confusion. +# Fallback Cloudflare Workers deploy via Direct Upload (wrangler deploy). +# Bypasses the Cloudflare Git Integration build system entirely. +# Uses wrangler deploy (Workers + Assets) rather than the deprecated +# `wrangler pages deploy` now that wrangler.toml uses [assets] syntax. # Required secrets: CLOUDFLARE_API_TOKEN, CLOUDFLARE_ACCOUNT_ID -name: Deploy to Cloudflare Pages +name: Deploy to Cloudflare Workers on: push: @@ -18,8 +19,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Deploy site/ to Cloudflare Pages - run: npx wrangler@latest pages deploy site/ --project-name=boj-server + - name: Deploy site/ to Cloudflare Workers (static assets) + run: npx wrangler@latest deploy env: CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} diff --git a/wrangler.toml b/wrangler.toml index c515d103..f16080eb 100644 --- a/wrangler.toml +++ b/wrangler.toml @@ -1,7 +1,18 @@ # SPDX-License-Identifier: MPL-2.0 -# Cloudflare Pages configuration for boj-server.net. -# The site is a no-build static bundle; Pages serves the `site/` directory as-is. +# Cloudflare Workers static-asset configuration for boj-server.net. +# Migrated from Pages (pages_build_output_dir) to Workers + Assets format: +# the old key is not recognised by the Workers build system post-Pages merger. +# +# [build] command="" prevents the Git Integration from attempting to install +# .tool-versions entries (Zig, Elixir, Idris2, Deno) before a non-existent +# build step. The site/ directory is deployed as-is with no build phase. +# For the GitHub Actions fallback see .github/workflows/pages-deploy.yml. name = "boj-server" compatibility_date = "2026-06-24" -pages_build_output_dir = "site" + +[assets] +directory = "site" + +[build] +command = ""