Skip to content

Commit a06d6d3

Browse files
committed
fix(cloudflare): migrate wrangler.toml to Workers + Assets, fix Git Integration build
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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F8pqMfJViUaKabWKNQ9wUg
1 parent 3077b4f commit a06d6d3

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)