Skip to content

ci: plain cf deploy + Worker Previews - #2

Merged
0froq merged 3 commits into
mainfrom
cursor/plain-cf-deploy-previews-045f
Oct 12, 2026
Merged

0froq merged 3 commits into
mainfrom
cursor/plain-cf-deploy-previews-045f

Conversation

@0froq

@0froq 0froq commented Oct 12, 2026 •

Copy link
Copy Markdown
Owner

Workers Builds can use the same flow as 0froq/poim#5 and 0froq/1000-observations: generate the Nuxt static docs site, then let cf bundle and deploy (including Worker Previews). Removed wrangler build --experimental-new-config --x-cf-build-output and cf deploy --prebuilt.

cloudflare.config.ts and wrangler.config.ts are unchanged (Worker name ui, assetsDirectory: ./dist, htmlHandling: drop-trailing-slash, notFoundHandling: 404-page). Library source is unchanged.

This repo is a pnpm workspace (docs/ is Nuxt). Two extra deploy-only fixes so dashboard pnpm exec cf deploy does not take the Nuxt autoconfig path:

  • docs/nuxt.config.ts pins nitro.preset: 'static'. Workers Builds sets WORKERS_CI; without the pin, pnpm generate logged Nitro preset: cloudflare-module and wrote dist/server/.
  • docs lists nuxt as a peerDependencies entry. cf at the workspace root otherwise detects Nuxt in docs/ and runs pnpm nuxt build (nuxt is not a root binary). With the peer, cf deploy uses the Wrangler bundler against dist/. pnpm still auto-installs the peer; nuxt generate / nuxt prepare still work.

Dashboard commands (need to be set in Workers Builds)

These builds still ran the old dashboard commands, so Worker Previews failed. The repo no longer has a --prebuilt path.

  • NODE_VERSION: 22
  • Build command: pnpm generate
  • Production deploy: pnpm exec cf deploy
  • Preview (Worker Previews): pnpm exec cf previews deploy

Local equivalent: pnpm deploy → pnpm generate && cf deploy. preview:deploy is pnpm generate && cf previews deploy.

Verification

Local (Node v22.22.2; WORKERS_CI=1 CI=1 for generate)

  • pnpm generate — Nitro static; dist/index.html, dist/404.html, dist/_headers. No _worker.js / _routes.json / _redirects / dist/server.
  • pnpm exec cf deploy --dry-run (no --prebuilt) — pass. Wrangler bundler; 532 asset files; Total Upload 0.00 KiB / gzip 0.02 KiB (assets-only Worker); no bindings. worker.config.json has name: "ui", htmlHandling: "drop-trailing-slash", notFoundHandling: "404-page".
  • cf previews deploy --dry-run — no such flag (cf 1.0.0-beta.12).
  • pnpm check (lint + typecheck + token contract) — pass.

GitHub Actions

  • check on d70f027 — pass.

Workers Builds Preview (d70f027, build 804e7155)

  • Generate on CI: Nitro static, Success: Build command completed.
  • Deploy then failed: dashboard still ran pnpm generate && pnpm exec wrangler build --experimental-new-config --x-cf-build-output then pnpm exec cf previews deploy --prebuilt.
  • Error: Build Output was not created by a Preview build. Same reason poim dropped --prebuilt.
  • Not a repo script failure. After the dashboard commands above are saved, this preview should be retried.

Not verified: a production cf deploy to the live Worker. The GitHub Preview comment still does not include a URL; that is expected with cf previews deploy (URL is in build logs).

Open in Web Open in Cursor 

Workers Builds now generate then `cf deploy` / `cf previews deploy`, matching poim and 1000-observations. Local deploy/preview:deploy scripts follow the same path.

Co-authored-by: froQ <sayhola@froq.me>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 12, 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 failed
View logs
ui d70f027 Oct 12 2026, 12:50 PM

Workers Builds sets WORKERS_CI, which otherwise makes Nitro pick cloudflare-module. Pin nitro.preset to static. List nuxt as a docs peer so cf at the workspace root does not run pnpm nuxt build and instead bundles dist/.

Co-authored-by: froQ <sayhola@froq.me>
@0froq
0froq marked this pull request as ready for review October 12, 2026 12:49
@cloudflare-workers-and-pages

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅

View logs ↗
No Preview URL. Enable ↗ 99a84d8 2026-10-12T13:18:23.482Z View logs ↗

@0froq
0froq merged commit 49c290f into main Oct 12, 2026
2 checks passed
0froq added a commit that referenced this pull request Oct 15, 2026
PR #4 moved nuxt back into docs dependencies. cf deploy at the monorepo
root then runs `pnpm nuxt build`, but nuxt is not on the root PATH.
Restore the peerDependency pattern from #2 so generate stays in docs and
cf bundles ./dist via Wrangler after Workers Build runs pnpm generate.

Co-authored-by: Cursor Agent <cursoragent@cursor.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.

2 participants