Workers - Test out code changes before shipping with per-branch preview deployments for Cloudflare Workers
11mo ago
Source
CloudflareWorkers - Test out code changes before shipping with per-branch preview deployments for Cloudflare Workerscloudflare.comNow, when you connect your Cloudflare Worker to a git repository on GitHub or GitLab, each branch of your repository has its own stable preview URL, that you can use to preview code changes before merging the pull request and deploying to production. This works the same way that Cloudflare Pages does — every time you create a pull request, you'll automatically get a shareable preview link where you can see your changes running, without affecting production. The link stays the same, even as you add commits to the same branch. These preview URLs are named after your branch and are posted as a comment to each pull request. The URL stays the same with every commit and always points to the latest version of that branch. Preview URL types Each comment includes two preview URLs as shown above: Commit Preview URL : Unique to the specific version/commit (e.g., -..workers.dev ) Branch Preview URL : A stable alias based on the branch name (e.g., -..workers.dev ) How it works When you create a pull request: A preview alias is automatically created based on the Git branch name (e.g., becomes -..workers.dev ) No configuration is needed , the alias is generated for you The link stays the same even as you add commits to the same branch Preview URLs are posted directly to your pull request as comments (just like they are in Cloudflare Pages) Custom alias name You can also assign a custom preview alias using the Wrangler CLI , by passing the --preview-alias flag when uploading a version of your Worker: wrangler versions upload --preview-alias staging Limitations while in beta Only available on the workers.dev subdomain (custom domains not yet supported) Requires Wrangler v4.21.0+ Preview URLs are not generated for Workers that use Durable Objects Not yet supported for Workers for Platforms
You might also wanna read
Cloudflare expands AI bot management tools with granular traffic controls for all customers
Cloudflare is celebrating the second "Content Independence Day" by expanding AI traffic management options for all website owners. Building
Workers - Simpler runtime types with @cloudflare/workers-types v5
Cloudflare·1d ago
Cloudflare One - Hostname routing for Cloudflare Mesh
Cloudflare·2d ago
Cache - Cache multiple versions of a URL with Vary
Cloudflare·2d ago
AI Search - Manage AI Search sync jobs with Wrangler CLI
Cloudflare·2d ago
Workers - Work across multiple accounts with Wrangler auth profiles
Cloudflare·2d ago

Comments
Sign in to join the conversation.
No comments yet. Be the first.