Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: ToriLindsay <[email protected]>
  • Loading branch information
aninibread and ToriLindsay authored Jan 28, 2025
1 parent e240fdd commit c0513fc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions src/content/docs/workers/ci-cd/builds/index.mdx
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
---
pcx_content_type: concept
title: Builds
description: Use Workers Builds to integrate with Git and automatically build and deploy your Worker when push a change
description: Use Workers Builds to integrate with Git and automatically build and deploy your Worker when pushing a change
sidebar:
group:
badge:
text: Beta
---

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.
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.
Support for creating a _new Worker_ from importing a Git repository is coming soon.

## Get started

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:

1. Select your Worker in the [Workers & Pages Dashboard](https://dash.cloudflare.com) and navigate to **Settings > Build**
2. Select the Git provider you'd like to connect to or select **Connect** and follow the prompts to install the Cloudflare [Git integration](/workers/ci-cd/builds/git-integration/) on your Git account.
1. Select your Worker in the [Workers & Pages Dashboard](https://dash.cloudflare.com) and navigate to **Settings > Build**.
2. Select the Git provider you would like to connect to or select **Connect** and follow the prompts to install the Cloudflare [Git integration](/workers/ci-cd/builds/git-integration/) on your Git account.
3. Configure your [build settings](/workers/ci-cd/builds/configuration/) by selecting your desired Git repository, branch, and configure commands for your build.
4. Push a commit to your Git repository to trigger a build and deploy for your Worker.

:::caution

When connecting a repository to a Workers project, the Worker name in the Cloudflare dashboard must match the `name` in the wrangler.toml file in the specified root directory, or the build will fail. This ensures that the Worker deployed from the repository is consistent with the Worker registered in the Cloudflare dashboard. For details, see the [Workers name requirement](/workers/ci-cd/builds/troubleshoot/#workers-name-requirement).
When connecting a repository to a Workers project, the Worker name in the Cloudflare dashboard must match the `name` in the wrangler.toml file in the specified root directory, or the build will fail. This ensures that the Worker deployed from the repository is consistent with the Worker registered in the Cloudflare dashboard. For details, see [Workers name requirement](/workers/ci-cd/builds/troubleshoot/#workers-name-requirement).

:::

## 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 also view the build details by selecting **View build** in the associated new [version](/workers/configuration/versions-and-deployments/) created under Version History. There you will also find the [preview URL](/workers/configuration/previews/) generated by the version under Version ID.
If the build is successful, you can view the build details by selecting **View build** in the associated new [version](/workers/configuration/versions-and-deployments/) created under Version History. There you will also find the [preview URL](/workers/configuration/previews/) generated by the version under Version ID.

:::note[Builds, Versions, Deployments]
:::note[Builds, versions, deployments]

If a build succeeds, it is uploaded as a version. If the build is configured to deploy (for example, with `wrangler deploy` set as the deploy command), the uploaded version will be automatically promoted to the Active Deployment.

Expand All @@ -45,4 +45,4 @@ If a build succeeds, it is uploaded as a version. If the build is configured to

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.

If you prefer to disable only automatic deployments while still allowing builds to run automatically and save as [Versions](/workers/configuration/versions-and-deployments/) (without promoting them to Active Deployment), update your deploy command to: `npx wrangler versions upload`.
To disable automatic deployments while still allowing builds to run automatically and save as [versions](/workers/configuration/versions-and-deployments/) (without promoting them to an active deployment), update your deploy command to: `npx wrangler versions upload`.
4 changes: 2 additions & 2 deletions src/content/docs/workers/ci-cd/builds/troubleshoot.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Here are some common build errors that may surface in the build logs or general

`✘ [ERROR] The name in your wrangler.toml file (<Worker name>) must match the name of your Worker. Please update the name field in your wrangler.toml file.`

When connecting a Git repository to your Workers project, the specified name for the Worker on the Cloudflare dashboard must match the `name` argument in the wrangler.toml file located in the specified root directory. If it doesn't match, please update the name field in your wrangler.toml file to match the name of the Worker on the dashboard.
When connecting a Git repository to your Workers project, the specified name for the Worker on the Cloudflare dashboard must match the `name` argument in the wrangler.toml file located in the specified root directory. If it does not match, update the name field in your wrangler.toml file to match the name of the Worker on the dashboard.

The build system uses the `name` argument in the wrangler.toml to determine which Worker to deploy to Cloudflare's global network. This requirement ensures consistency between the Worker's name on the dashboard and the deployed Worker.

Expand Down Expand Up @@ -58,4 +58,4 @@ If you are running into errors associated with your Git integration, you can try

## For additional support

If you discover additional issues or would like to provide feedback, please reach out to us in the [Cloudflare Developers Discord](https://discord.com/channels/595317990191398933/1052656806058528849).
If you discover additional issues or would like to provide feedback, reach out to us in the [Cloudflare Developers Discord](https://discord.com/channels/595317990191398933/1052656806058528849).

0 comments on commit c0513fc

Please sign in to comment.