Builds
Workers Builds allows you to connect an existing Worker to its GitHub or GitLab repository, enabling automated builds and deployments for your project on push.
Support for creating a new Worker from importing a Git repository is coming soon.
If you have an existing Worker and have pushed the project to a Git repository, you can now connect the repository to your Worker, enabling automatic builds and deployments.
To set up builds for your Worker:
- Select your Worker in the Workers & Pages Dashboard โ and navigate to Settings > Build.
- Select the Git provider you would like to connect to or select Connect and follow the prompts to install the Cloudflare Git integration on your Git account.
- Configure your build settings by selecting your desired Git repository, branch, and configure commands for your build.
- Push a commit to your Git repository to trigger a build and deploy for your Worker.
You can monitor a build's status and its build logs by navigating to View build history at the bottom of the Deployments tab of your Worker.
If the build is successful, you can view the build details by selecting View build in the associated new version created under Version History. There you will also find the preview URL generated by the version under Version ID.
To disable automatic builds and deployments from your Git repository, go to Settings > Builds and select Disconnect under Git Repositories. If you want to switch to a different repository for your Worker, you must first disable builds, then reconnect to select the new repository.
To disable automatic deployments while still allowing builds to run automatically and save as versions (without promoting them to an active deployment), update your deploy command to: npx wrangler versions upload
.