Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 21 additions & 7 deletions src/content/docs/workers/ci-cd/builds/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sidebar:
order: 2
---

import { DirectoryListing } from "~/components";
import { DirectoryListing, Render, Tabs, TabItem } from "~/components";

When connecting your Git repository to your Worker, you can customize the configurations needed to build and deploy your Worker.

Expand Down Expand Up @@ -82,12 +82,26 @@ It is recommended to consistently use the same API token across all uploads and

## Environment variables

You can provide custom environment variables to your build by configuring them in the Cloudflare dashboard:
You can provide custom environment variables to your build.

1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com) and select your account.
2. In **Account Home**, select **Workers & Pages**.
3. In **Overview**, select your Worker.
4. Select **Settings** > **Environment variables**.
<Tabs>
<TabItem label="Dashboard">

To add environment variables via the dashboard:

1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com) and select your account.
2. In **Account Home**, select **Workers & Pages**.
3. In **Overview**, select your Worker.
4. Select **Settings** > **Environment variables**.
</TabItem>
<TabItem label="Wrangler">
To add env variables using Wrangler, define text and JSON via the `[vars]` configuration in your Wrangler file.

<Render file="envvar-example" />
</TabItem>
</Tabs>

### Default variables

The following system environment variables are injected by default (but can be overridden):

Expand All @@ -97,4 +111,4 @@ The following system environment variables are injected by default (but can be o
| `WORKERS_CI` | `1` | Changing build behaviour when run on Workers Builds versus locally |
| `WORKERS_CI_BUILD_UUID` | `<build-uuid-of-current-build>` | Passing the Build UUID along to custom workflows |
| `WORKERS_CI_COMMIT_SHA` | `<sha1-hash-of-current-commit>` | Passing current commit ID to error reporting, for example, Sentry |
| `WORKERS_CI_BRANCH` | `<branch-name-from-push-event` | Customizing build based on branch, for example, disabling debug logging on `production` |
| `WORKERS_CI_BRANCH` | `<branch-name-from-push-event` | Customizing build based on branch, for example, disabling debug logging on `production` |