Skip to content
Cloudflare Docs

Builds

The Cloudflare Git integration lets you connect a new or existing Worker to a GitHub or GitLab repository, enabling automated builds and deployments for your Worker on push.

Get started

Connect a new Worker

To create a new Worker and connect it to a GitHub or GitLab repository:

  1. Log in to the Cloudflare dashboard and select your account.
  2. Go to Workers & Pages.
  3. Select Create.
  4. Under Import a repository, select a Git account.
  5. Select the repository you want to import from the list. You can also use the search bar to narrow the results.
  6. Configure your project and select Save and Deploy.
  7. Preview your Worker at its provided workers.dev subdomain.

Connect an existing Worker

To connect an existing Worker to a GitHub or GitLab repository:

  1. Log in to the Cloudflare dashboard and select your account.
  2. Go to Workers & Pages.
  3. Select the Worker you want to connect to a repository.
  4. Select Settings and then Builds.
  5. Select Connect and follow the prompts to connect the repository to your Worker and configure your build settings.
  6. Push a commit to your Git repository to trigger a build and deploy to your Worker.

View build and preview URL

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.

Disconnecting builds

To disconnect a Worker from a GitHub or GitLab repository:

  1. Log in to the Cloudflare dashboard and select your account.
  2. Go to Workers & Pages.
  3. Select the Worker you want to disconnect from a repository.
  4. Select Settings and then Builds.
  5. Select Disconnect.

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.