chore: switch deploy to Cloudflare Workers, fix build - #12
Merged
Conversation
Site is now deployed via Cloudflare Pages builds, not GitHub Actions, so the deploy.yml workflow is dead weight. Keep test-deploy.yml as a PR build-check gate. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Cloudflare's Workers Builds auto-detects Astro projects that lack a wrangler config and silently enables the @astrojs/cloudflare SSR adapter to build a deployable Worker. That adapter's bundling path doesn't resolve the @styles/* tsconfig alias the same way plain `astro build` does, so the CF build failed with: Can't resolve '@styles/global.css' in '.../src/pages/blog' This site is fully static (see CLAUDE.md), so it only needs Workers static assets, not the SSR adapter. Adding an explicit wrangler.jsonc with an `assets.directory` pointing at dist/ stops the auto-detection and lets Workers Builds deploy the plain static build output. Also adds `wrangler` as a devDependency and a `deploy` npm script so `wrangler deploy` is available without relying on the CI image having it preinstalled. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
blog | 5f38084 | Aug 11 2026, 07:18 AM |
Adding wrangler earlier in this branch was done with a local npm
11.6.2 (Node 25), which resolved optional deps differently than the
npm 10.9.2 both GitHub Actions and Cloudflare Workers Builds actually
use. That left the lockfile pinning @emnapi/core and @emnapi/runtime
at 1.11.1 while the dependency tree needs 1.11.3, so `npm ci` under
npm 10.9.2 failed with EUSAGE ("Missing: @emnapi/runtime@1.11.3 from
lock file").
Regenerated node_modules/package-lock.json from scratch using
npm@10.9.2 (via npx) to match CI exactly. Verified `npm ci` succeeds
under npm 10.9.2 and the build/wrangler dry-run still work.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Cloudflare's Workers Builds already runs the build-pass check on every push/PR (see wrangler.jsonc), making the separate test-deploy.yml GitHub Actions workflow redundant. Drop it and update docs to point at Cloudflare Workers as the actual host (they'd been mislabeled as Cloudflare Pages) and CI gate. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.github/workflows/deploy.yml(GitHub Pages deploy) — hosting has moved to Cloudflare; updateCLAUDE.md/README.mdreferences accordingly.test-deploy.ymlis kept as the PR build-check gate.Can't resolve '@styles/global.css'): with nowrangler.jsoncin the repo, Cloudflare auto-detects the Astro project and silently enables the@astrojs/cloudflareSSR adapter, whose bundling path doesn't resolve the@styles/*tsconfig alias the same way plainastro builddoes. Since this site is fully static, it only needs Workers static-assets hosting — addedwrangler.jsoncwithassets.directory: "./dist"to stop that auto-detection.wrangleras a devDependency and adeploynpm script (wrangler deploy).Test plan
npm run buildsucceeds locally (astro check + astro build)npx wrangler deploy --dry-runcorrectly readsdist/(133 files) with the newwrangler.jsoncblog(used asnameinwrangler.jsonc) and its Build/Deploy commands arenpm run build/npx wrangler deploy🤖 Generated with Claude Code