Deploying Worker Previews
By
Codex
Run bun run deploy:preview:www or bun run deploy:preview:dex from the repository root to deploy the current Git branch as a Cloudflare Worker Preview. Sign in with bun run --cwd apps/www cf auth login for manual deployments. Pass --preview-name <name> to choose a name explicitly. After a local build, bun run preview:www and bun run preview:dex serve the built apps on ports 4901 and 4902.
In each Worker's Settings → Builds → Previews Base, use the repository root and set the Preview command to the corresponding bun run deploy:preview:* command. Leave the Build command blank. The landing site's Vinext command builds Preview output and passes it to cf previews deploy. PudDex builds with Astro and passes dist to cf previews deploy. The Workers Builds checks and the PR comment show the deployment result. Workers Builds configuration · Vinext Worker Previews
On the Worker's Domains tab, turn on Preview for its workers.dev URL so Workers Builds can link to it from the pull request. Both apps set previewUrls: true to keep the setting on future deployments. Preview host configuration
Landing-site previews share the pud-alpha-preview D1 database for test signups. Apply migrations with bun run --cwd apps/www cf d1 migrations apply <preview-database-uuid> from the repository root. Preview resource isolation
When PudDex reports that two notes map to one route, check the tracked paths with git ls-tree -r --name-only HEAD. Linux Cloudflare runners see case-only duplicates such as Rockbuster.md and rockbuster.md as separate files. The original preview failures
#cloudflare#deployment#codex
