Configuration
When connecting your repository, you can configure how to build and deploy your Worker.
Build settings can be found by navigating to Settings > Build within your Worker. Note that when you update and save build settings, the updated settings will be applied in your next build. The following configurations are available:
Setting | Description |
---|---|
Git account | Select the git account you would like to use. After initial connection, you can continue to use this git account for future projects. |
Git repository | Choose the git repository you would like to connect your Worker to. |
Git branch | Select the branch you would like Cloudflare to listen to for new commits. This will be defaulted to main . |
Build command (Optional) | Set a build command if your project requires a build step. This is necessary, for example, when using a front-end framework such as Astro or Remix. |
Deploy command | The deploy command lets you set the specific Wrangler command to deploy your Worker. Your deploy command will default to npx wrangler deploy but you may customize this command if for example you want to create a version of your Worker or just run npm run deploy . Workers Builds will use the Wrangler version set in your package json . |
Root directory (Optional) | Specify the root directory of your repository. The root directory describes where the build command will be run. |
API token (Optional) | By default, Cloudflare will automatically generate an API token for your account when using Workers Builds. Workers Builds will continue to use this API token for all subsequent projects and builds. Alternatively, you can create your own API token, or select one that you already own. |
Build variables and secrets (Optional) | Add environment variables and secrets accessible only to your build. Build variables will not be accessible at runtime. If you would like to configure runtime variables you can do so in Settings > Variables & Secrets |