Skip to content

Commit afc094f

Browse files
fix(cloudflare): migrate wrangler.toml to Workers + Assets format (#248)
## Problem The "Workers Builds: boj-server" check has been failing because: 1. **`pages_build_output_dir`** is not recognised by the post-Pages-merger Cloudflare Workers build system. It interprets the project as a Workers script deployment and looks for a JS entry point. 2. **No `[build] command=""`** — the Git Integration attempts to install every runtime listed in `.tool-versions` (Zig 0.15.1, Elixir 1.18.4, Idris2 0.8.0, Deno 2.7.14) before a build step that doesn't exist, then fails. (The `pages-deploy.yml` GitHub Actions fallback was written to work around exactly this problem, but the Cloudflare Git Integration check itself kept showing red.) ## Fix - `wrangler.toml`: replace deprecated `pages_build_output_dir = "site"` with the current Workers static-assets syntax: ```toml [assets] directory = "site" [build] command = "" ``` - `.github/workflows/pages-deploy.yml`: update fallback deploy from deprecated `wrangler pages deploy` to `wrangler deploy`, consistent with the new Workers format. ## Test plan - [ ] Cloudflare Git Integration build succeeds (no `.tool-versions` install attempt, no missing-entry-point error) - [ ] `pages-deploy.yml` GitHub Actions fallback still deploys `site/` correctly on push to main - [ ] `site/` content and `_headers`/`_redirects` are unaffected 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01F8pqMfJViUaKabWKNQ9wUg --- _Generated by [Claude Code](https://claude.ai/code/session_01F8pqMfJViUaKabWKNQ9wUg)_ Co-authored-by: Claude <noreply@anthropic.com>
1 parent 3077b4f commit afc094f

2 files changed

Lines changed: 21 additions & 9 deletions

File tree

.github/workflows/pages-deploy.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# SPDX-License-Identifier: MPL-2.0
2-
# Fallback Cloudflare Pages deploy via Direct Upload (wrangler pages deploy).
3-
# Bypasses the Cloudflare build system entirely — no .tool-versions install
4-
# attempt, no `wrangler deploy` (Workers command) confusion.
2+
# Fallback Cloudflare Workers deploy via Direct Upload (wrangler deploy).
3+
# Bypasses the Cloudflare Git Integration build system entirely.
4+
# Uses wrangler deploy (Workers + Assets) rather than the deprecated
5+
# `wrangler pages deploy` now that wrangler.toml uses [assets] syntax.
56
# Required secrets: CLOUDFLARE_API_TOKEN, CLOUDFLARE_ACCOUNT_ID
6-
name: Deploy to Cloudflare Pages
7+
name: Deploy to Cloudflare Workers
78

89
on:
910
push:
@@ -18,8 +19,8 @@ jobs:
1819
runs-on: ubuntu-latest
1920
steps:
2021
- uses: actions/checkout@v4
21-
- name: Deploy site/ to Cloudflare Pages
22-
run: npx wrangler@latest pages deploy site/ --project-name=boj-server
22+
- name: Deploy site/ to Cloudflare Workers (static assets)
23+
run: npx wrangler@latest deploy
2324
env:
2425
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
2526
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}

wrangler.toml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
11
# SPDX-License-Identifier: MPL-2.0
2-
# Cloudflare Pages configuration for boj-server.net.
3-
# The site is a no-build static bundle; Pages serves the `site/` directory as-is.
2+
# Cloudflare Workers static-asset configuration for boj-server.net.
3+
# Migrated from Pages (pages_build_output_dir) to Workers + Assets format:
4+
# the old key is not recognised by the Workers build system post-Pages merger.
5+
#
6+
# [build] command="" prevents the Git Integration from attempting to install
7+
# .tool-versions entries (Zig, Elixir, Idris2, Deno) before a non-existent
8+
# build step. The site/ directory is deployed as-is with no build phase.
9+
# For the GitHub Actions fallback see .github/workflows/pages-deploy.yml.
410

511
name = "boj-server"
612
compatibility_date = "2026-06-24"
7-
pages_build_output_dir = "site"
13+
14+
[assets]
15+
directory = "site"
16+
17+
[build]
18+
command = ""

0 commit comments

Comments
 (0)