Skip to content

chore: switch deploy to Cloudflare Workers, fix build - #12

Merged
behitek merged 6 commits into
mainfrom
upgrade/astro-7
Aug 11, 2026
Merged

chore: switch deploy to Cloudflare Workers, fix build#12
behitek merged 6 commits into
mainfrom
upgrade/astro-7

Conversation

@behitek

@behitek behitek commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Summary

  • Remove .github/workflows/deploy.yml (GitHub Pages deploy) — hosting has moved to Cloudflare; update CLAUDE.md/README.md references accordingly. test-deploy.yml is kept as the PR build-check gate.
  • Fix the Cloudflare Workers Builds failure (Can't resolve '@styles/global.css'): with no wrangler.jsonc in the repo, Cloudflare auto-detects the Astro project and silently enables the @astrojs/cloudflare SSR adapter, whose bundling path doesn't resolve the @styles/* tsconfig alias the same way plain astro build does. Since this site is fully static, it only needs Workers static-assets hosting — added wrangler.jsonc with assets.directory: "./dist" to stop that auto-detection.
  • Added wrangler as a devDependency and a deploy npm script (wrangler deploy).

Test plan

  • npm run build succeeds locally (astro check + astro build)
  • npx wrangler deploy --dry-run correctly reads dist/ (133 files) with the new wrangler.jsonc
  • Confirm Cloudflare dashboard's Workers Builds project is named blog (used as name in wrangler.jsonc) and its Build/Deploy commands are npm run build / npx wrangler deploy
  • Verify the live Workers Builds run succeeds after merge

🤖 Generated with Claude Code

behitek and others added 2 commits August 11, 2026 13:50
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>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 11, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
blog 5f38084 Aug 11 2026, 07:18 AM

behitek and others added 4 commits August 11, 2026 14:00
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>
@behitek
behitek merged commit 960b323 into main Aug 11, 2026
1 check passed
@behitek
behitek deleted the upgrade/astro-7 branch August 11, 2026 07:18
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