Skip to content

fix(ci): force bun + pin wrangler in Deploy workflow#3

Open
dtTheodore wants to merge 1 commit into
mainfrom
fix/ci-deploy-cloudflare-bun
Open

fix(ci): force bun + pin wrangler in Deploy workflow#3
dtTheodore wants to merge 1 commit into
mainfrom
fix/ci-deploy-cloudflare-bun

Conversation

@dtTheodore

Copy link
Copy Markdown
Collaborator

Why the Deploy workflow has failed since the first run

Two independent faults, both present from the very first Deploy run:

1. deploy-worker — npm chokes on workspace:* (fixed in this PR)

wrangler-action runs with workingDirectory: apps/api/cloudflare, which has no lockfile. The action therefore infers npm and runs npm i wrangler@…, which walks up to apps/api/package.json and dies on bun's workspace:* protocol:

npm error code EUNSUPPORTEDPROTOCOL
npm error Unsupported URL Type "workspace:": workspace:*

Fix: set packageManager: bun on both wrangler-action steps (bun handles workspace:*, proven by the pages job which already runs from the repo root with bun), and pin wranglerVersion: "4.95.0" to match the project's compatibility_date (2026-05-21) and avoid the action's stale 3.90.0 default.

2. deploy-pages — Cloudflare Authentication error [code: 10000] (fixed via secrets, not in this diff)

The build succeeded but wrangler pages deploy failed authenticating to the Cloudflare API. Resolved out-of-band by setting the repo secrets CLOUDFLARE_API_TOKEN (freshly minted, correctly scoped) and CLOUDFLARE_ACCOUNT_ID to account 52cb969c…, which owns contextmem-backend, D1 contextmem, R2 contextmem-context, and subdomain petlofi.

Verification

After merge, the on-push Deploy runs. Expected: both jobs pass. Diff is limited to .github/workflows/deploy.yml (+6 lines).

The deploy-worker job runs wrangler-action with
workingDirectory: apps/api/cloudflare, which has no lockfile. The action
infers npm, which fails on bun's `workspace:*` protocol
(EUNSUPPORTEDPROTOCOL) before it can deploy. Set packageManager: bun on
both wrangler-action steps so installs use bun (which handles
workspace:*), and pin wranglerVersion to 4.95.0 to match the project's
compatibility_date and avoid the action's stale 3.90.0 default.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant