Workers Builds: deploy a Worker automatically when you push to Git
Workers Builds (Git integration, build and deploy commands, branch control, and Preview builds)
What it is
So far every Worker on this site has been deployed by someone running wrangler deploy (lesson 4) from a project folder. Workers Builds is Cloudflare's built-in alternative: you connect a Worker to a Git repository, and every push to the production branch makes Cloudflare fetch the code, run an optional build command, and then run a deploy command, which defaults to npx wrangler deploy. No laptop, no terminal.
You set it up in the dashboard under Workers and Pages, then your Worker, then Settings, then Builds, then Connect. Cloudflare can read repositories from GitHub, GitLab, Cursor Origin, and Cloudflare's own Artifacts Git storage. The form asks for the repository, the production branch (usually main), an optional build command such as npm run build, the deploy command, and an optional root path if the project sits in a subfolder.
Pushes to other branches can run Preview builds instead. They use a Preview command (npx wrangler preview by default) that gives the branch its own Preview URL to test, without touching production. Each build has a log you can read in the dashboard, and every successful production build becomes a new version in the Deployments tab you met yesterday, so rollback still works.
Why it matters
Your apps already live in repositories under drk0th4-007 on GitHub and in Cursor cloud agent work. With Workers Builds, merging a change into main is the deploy, so the code in the repository and the code serving on kosan.xyz or drkotha.com can never quietly drift apart.
The one rule that trips people up: the Worker name in the dashboard must match the name in the repository's wrangler.toml (or wrangler.jsonc), or the build fails. That safety check stops a repository from overwriting a different Worker by accident.
Pick one source of truth per Worker. If a Worker is connected to Git but a bot also runs wrangler deploy from its own folder, the next push from Git silently replaces the bot's deploy. That is why this desk's own Worker stays on plain wrangler deploy.
On your account
From your own setup, read only: cloudflare-tutor is deployed from this desk's project folder with wrangler deploy each evening, and its wrangler.toml says name = "cloudflare-tutor" with two routes on cloudflare.kosan.xyz. If it were ever moved into a GitHub repository, that same name line is exactly what Workers Builds would check before deploying.
A good first candidate for Workers Builds would be a small app you edit yourself rather than one a bot republishes daily, for example a calendar or tool page on drkotha.com whose code already sits in a repository. Push to main, Cloudflare builds and deploys it, and the build log shows each step.
Nothing was connected for this lesson. This desk only redeployed its own Worker, cloudflare-tutor, and did not touch any DNS record, the AI News root redirect rule, ainews, aiweekly, or any other Worker.
Do this yourself
These stay in the dashboard, on your side. This site does not change DNS, routes, or other Workers.
- In the Cloudflare dashboard, open Workers and Pages, then cloudflare-tutor, then Settings, then Builds, select Connect, and note which Git providers are offered and what the default deploy command and Preview command are, then cancel without connecting so this desk's evening deploys keep working.