Skip to content
Merged
Show file tree
Hide file tree
Changes from 85 commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
18736b2
Adding docs for Workers CI/CD in Closed Beta
aninibread Sep 5, 2024
29cb3a7
Deleting redundant CI/CD related pages. Deleted content has been move…
aninibread Sep 5, 2024
ee5eb0e
Update src/content/docs/workers/ci-cd/build-system/build-configuratio…
aninibread Sep 5, 2024
d08eeb8
Update src/content/docs/workers/ci-cd/build-system/build-configuratio…
aninibread Sep 5, 2024
ba3c060
Update src/content/docs/workers/ci-cd/build-system/build-configuratio…
aninibread Sep 5, 2024
0f81ccb
Update src/content/docs/workers/ci-cd/build-system/build-configuratio…
aninibread Sep 5, 2024
c7a2d30
Update src/content/docs/workers/ci-cd/index.mdx
aninibread Sep 5, 2024
2c60e9d
Update src/content/docs/workers/ci-cd/index.mdx
aninibread Sep 5, 2024
85c2cbc
Added link reference for Wrangler environments.
aninibread Sep 5, 2024
032e966
Added Build Limits to Overview Page.
aninibread Sep 5, 2024
5978781
added more to troubleshooting page
aninibread Sep 5, 2024
6b5d23f
Update src/content/docs/workers/ci-cd/build-system/troubleshoot.mdx
aninibread Sep 5, 2024
c37c2d7
Update src/content/docs/workers/ci-cd/build-system/troubleshoot.mdx
aninibread Sep 5, 2024
6c273b5
Update src/content/docs/workers/ci-cd/build-system/build-configuratio…
aninibread Sep 5, 2024
a42186a
Remove wordy description in Builds index.mdx
aninibread Sep 5, 2024
019ff16
remaning section to builds from build system
aninibread Sep 5, 2024
4938c6b
Referencing Builds instead of Build System
aninibread Sep 5, 2024
1ca9a27
Adding reference for Wrangler Environments
aninibread Sep 5, 2024
bd9ca0d
Change reference of Workers build system to Workers Builds
aninibread Sep 5, 2024
3934fa9
Few tweaks
kodster28 Sep 6, 2024
cf4dd78
New change in release now includes non-'Main' branch support.
aninibread Sep 6, 2024
3bf7a8e
Improve instructions for monorepo and wrangler env support.
aninibread Sep 6, 2024
cb01b51
adding back some tweaks
aninibread Sep 6, 2024
60fb91d
Updating build image page and header
aninibread Sep 18, 2024
9a733c4
Update src/content/docs/workers/ci-cd/builds/build-configuration.mdx
aninibread Sep 18, 2024
95b3193
Update src/content/docs/workers/ci-cd/builds/index.mdx
aninibread Sep 18, 2024
e0a20b3
small tweaks + note in change log
aninibread Sep 18, 2024
ab2f1c3
small tweaks
aninibread Sep 18, 2024
e1561b8
Update src/content/docs/workers/ci-cd/index.mdx
aninibread Sep 19, 2024
518372a
Update src/content/docs/workers/ci-cd/builds/index.mdx
aninibread Sep 19, 2024
e4bf4f5
Update src/content/docs/workers/ci-cd/builds/troubleshoot.mdx
aninibread Sep 19, 2024
ad72ec4
Update src/content/docs/workers/ci-cd/builds/troubleshoot.mdx
aninibread Sep 19, 2024
e1c0774
adding suggested changes
aninibread Sep 19, 2024
f8fd013
Merge branch 'anni/wcicd' of https://github.com/cloudflare/cloudflare…
aninibread Sep 19, 2024
46326c9
Update src/content/docs/workers/ci-cd/builds/index.mdx
aninibread Sep 19, 2024
a154fc6
Update src/content/docs/workers/ci-cd/builds/index.mdx
aninibread Sep 19, 2024
b88b9d4
Update src/content/docs/workers/ci-cd/builds/build-configuration.mdx
aninibread Sep 19, 2024
0028f50
Update src/content/docs/workers/ci-cd/external-cicd.mdx
aninibread Sep 19, 2024
12b1c4a
Update src/content/docs/workers/ci-cd/builds/build-configuration.mdx
aninibread Sep 19, 2024
e071fdb
Update src/content/docs/workers/ci-cd/builds/build-image.mdx
aninibread Sep 19, 2024
68e90ab
why cicd changes
aninibread Sep 19, 2024
d513628
Merge branch 'anni/wcicd' of https://github.com/cloudflare/cloudflare…
aninibread Sep 19, 2024
8b063cc
redirect and link updates
aninibread Sep 19, 2024
1f931e9
add pre-installed packages section
aninibread Sep 19, 2024
93d4e64
Merge branch 'production' into anni/wcicd
aninibread Sep 19, 2024
bbd1d45
add images, diagrams, and examples
aninibread Sep 19, 2024
6314b3d
Build setting details and changes
aninibread Sep 19, 2024
b8c991e
adding in default version update message
aninibread Sep 19, 2024
f352b67
adding troubleshooting view
aninibread Sep 19, 2024
2a9515e
nevi edits to anni's builds PR (#16962)
nevikashah Sep 20, 2024
4b149ff
trigger builds
WalshyDev Sep 20, 2024
b599c70
Update src/content/docs/workers/ci-cd/builds/build-configuration.mdx
aninibread Sep 23, 2024
a21f4c8
added git integration + individual external ci/cd pages + small tweaks
aninibread Sep 23, 2024
88dbeeb
Merge branch 'anni/wcicd' of https://github.com/cloudflare/cloudflare…
aninibread Sep 23, 2024
f7623f3
Update src/content/docs/workers/ci-cd/builds/configuration.mdx
aninibread Sep 23, 2024
9d34011
Link fixes
aninibread Sep 23, 2024
2479f75
Merge branch 'anni/wcicd' of https://github.com/cloudflare/cloudflare…
aninibread Sep 23, 2024
c69950f
Added a which ci/cd should i choose section. Added fix to git integra…
aninibread Sep 24, 2024
c2837fd
Update src/content/docs/workers/ci-cd/builds/build-image.mdx
aninibread Sep 24, 2024
03f5390
versions updates and added git troubleshooting
aninibread Sep 24, 2024
1bb08c3
small edit
aninibread Sep 24, 2024
2501833
edit on getting started
aninibread Sep 24, 2024
a8d6af8
removing enterprise from pricing plan
aninibread Sep 24, 2024
7a848cd
fix index
aninibread Sep 24, 2024
b2c7064
added change log for workers builds
aninibread Sep 24, 2024
baf4640
spelling mistake
aninibread Sep 24, 2024
b0d345e
Update src/content/docs/pages/configuration/git-integration.mdx
aninibread Sep 25, 2024
dd2ca78
Update src/content/docs/pages/configuration/git-integration.mdx
aninibread Sep 25, 2024
c61ae40
Update src/content/docs/pages/configuration/git-integration.mdx
aninibread Sep 25, 2024
a6ee00c
Update src/content/docs/pages/configuration/git-integration.mdx
aninibread Sep 25, 2024
ad6c3ba
Update src/content/docs/workers/ci-cd/builds/advanced-setups.mdx
aninibread Sep 25, 2024
e5a0295
Update src/content/docs/workers/ci-cd/index.mdx
aninibread Sep 25, 2024
94bff1b
Update src/content/docs/workers/ci-cd/index.mdx
aninibread Sep 25, 2024
9a1a188
Update src/content/docs/workers/ci-cd/index.mdx
aninibread Sep 25, 2024
e9ce294
Update src/content/docs/workers/configuration/versions-and-deployment…
aninibread Sep 25, 2024
21a3617
Update src/content/docs/workers/wrangler/deprecations.mdx
aninibread Sep 25, 2024
47945ac
existing Worker distinction
aninibread Sep 25, 2024
10f94fb
Merge branch 'anni/wcicd' of https://github.com/cloudflare/cloudflare…
aninibread Sep 25, 2024
779a780
small fix
aninibread Sep 25, 2024
9db5306
reverting github actions workflow change
aninibread Sep 25, 2024
9523cad
change page setup
aninibread Oct 24, 2024
ccfc092
Merge branch 'production' of https://github.com/cloudflare/cloudflare…
aninibread Oct 24, 2024
dc3ed88
Added build caching and build watch paths for Workers and updated the…
aninibread Oct 24, 2024
999f892
fix merge conflict marker
aninibread Oct 24, 2024
5b0090d
Revert "change page setup"
aninibread Oct 24, 2024
2d938fb
fix github actions merge conflict
aninibread Oct 24, 2024
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
12 changes: 4 additions & 8 deletions src/content/docs/pages/configuration/build-caching.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ To enable build caching in the Cloudflare 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 Pages project.
4. Go to **Settings** > **Builds & deployments** > **Build cache** and select **Enable build cache**.
4. Go to **Settings** > **Build** > **Build cache** and select **Enable**.

### Clear cache

Expand All @@ -27,8 +27,8 @@ The build cache can be cleared for a project if needed, such as when debugging b
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 Pages project.
4. Go to **Settings** > **Builds & deployments** > **Build cache**.
5. Select **Clear cache** to clear the build cache.
4. Go to **Settings** > **Build** > **Build cache**.
5. Select **Clear Cache** to clear the build cache.

## How build caching works

Expand Down Expand Up @@ -58,11 +58,7 @@ Caching the build output from frameworks can speed up subsequent build times. Th

## Limits

During this beta period, the following limits are imposed:
The following limits are imposed for build caching:

- **Retention**: Cache is purged seven days after its last read date. Unread cache artifacts are purged seven days after creation.
- **Storage**: Every project is allocated 10 GB. If the project cache exceeds this limit, the project will automatically start deleting artifacts that were read least recently.

## Feedback

If there are package managers or frameworks you want to see supported, let us know in the Pages channel of the [Cloudflare Developer Discord](https://discord.com/invite/cloudflaredev).
34 changes: 17 additions & 17 deletions src/content/docs/pages/configuration/build-watch-paths.mdx
Original file line number Diff line number Diff line change
@@ -1,58 +1,58 @@
---
pcx_content_type: concept
title: Build watch paths

---

When you connect a git repository to Pages, by default a change to any file in the repository will trigger a Pages build. You can configure Pages to include or exclude specific paths to specify if Pages should skip a build for a given path. This can be especially helpful if you are using a monorepo project structure and want to limit the amount of builds being kicked off.

## Configure paths

To configure which paths are included and excluded, go to your Pages project > Settings > Builds & deployments > Build watch paths. Pages will default to setting your project’s includes paths to everything (\[\*]) and excludes paths to nothing (`[]`).
To configure which paths are included and excluded:

1. In **Overview**, select your Pages project.
2. Go to **Settings** > **Build** > **Build watch paths**. Pages will default to setting your project’s includes paths to everything (\[\*]) and excludes paths to nothing (`[]`).

The configuration fields can be filled in two ways:

* **Static filepaths**: Enter the precise name of the file you are looking to include or exclude (for example, `docs/README.md`).
* **Wildcard syntax:** Use wildcards to match multiple path directories. You can specify wildcards at the start or end of your rule.
- **Static filepaths**: Enter the precise name of the file you are looking to include or exclude (for example, `docs/README.md`).
- **Wildcard syntax:** Use wildcards to match multiple path directories. You can specify wildcards at the start or end of your rule.

:::note[Wildcard syntax]


A wildcard (`*`) is a character that is used within rules. It can be placed alone to match anything or placed at the start or end of a rule to allow for better control over branch configuration. A wildcard will match zero or more characters.For example, if you wanted to match all branches that started with `fix/` then you would create the rule `fix/*` to match strings like `fix/1`, `fix/bugs`or `fix/`.


:::

For each path in a push event, build watch paths will be evaluated as follows:

* Paths satisfying excludes conditions are ignored first
* Any remaining paths are checked against includes conditions
* If any matching path is found, a build is triggered. Otherwise the build is skipped
- Paths satisfying excludes conditions are ignored first
- Any remaining paths are checked against includes conditions
- If any matching path is found, a build is triggered. Otherwise the build is skipped

Pages will bypass the path matching for a push event and default to building the project if:

* A push event contains 0 file changes, in case a user pushes a empty push event to trigger a build
* A push event contains 3000+ file changes or 20+ commits
- A push event contains 0 file changes, in case a user pushes a empty push event to trigger a build
- A push event contains 3000+ file changes or 20+ commits

## Examples

### Example 1

If you want to trigger a build from all changes within a set of directories, such as all changes in the folders `project-a/` and `packages/`

* Include paths: `project-a/*, packages/*`
* Exclude paths: \`\`
- Include paths: `project-a/*, packages/*`
- Exclude paths: \`\`

### Example 2

If you want to trigger a build for any changes, but want to exclude changes to a certain directory, such as all changes in a docs/ directory

* Include paths: `*`
* Exclude paths: `docs/*`
- Include paths: `*`
- Exclude paths: `docs/*`

### Example 3

If you want to trigger a build for a specific file or specific filetype, for example all files ending in `.md`.

* Include paths: `*.md`
* Exclude paths: \`\`
- Include paths: `*.md`
- Exclude paths: \`\`
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pcx_content_type: reference
title: Advanced Setups
description: Learn how to use Workers Builds with more advanced setups
sidebar:
order: 5
order: 7
---

## Monorepos
Expand Down
69 changes: 69 additions & 0 deletions src/content/docs/workers/ci-cd/builds/build-caching.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
pcx_content_type: concept
title: Build caching
description: Improve build times by caching build outputs and dependencies
sidebar:
order: 5
---

Improve Workers Builds build times by turning on build caching to restore dependencies and build output between builds. The first build to occur after enabling build caching on your Pages project will save to cache. Every subsequent build will restore from cache unless configured otherwise.

## Configuration

### Enable build caching

To enable build caching in the Cloudflare 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 Workers project.
4. Go to **Settings** > **Build** > **Build cache** and select **Enable**.

### Clear cache

The build cache can be cleared for a project when needed, such as when debugging build issues. To clear the build cache:

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 Workers project.
4. Go to **Settings** > **Build** > **Build cache**.
5. Select **Clear Cache** to clear the build cache.

## How build caching works

When enabled, build caching will automatically detect which package manager and framework the project is using from its `package.json` and cache data accordingly for the build.

The following shows which package managers and frameworks are supported for dependency and build output caching respectively.

### Package managers

Workers build cache will cache the global cache directories of the following package managers:

- [yarn](https://yarnpkg.com/)
- [npm](https://www.npmjs.com/)
- [pnpm](https://pnpm.io/)
- [node.js](https://nodejs.org/)

### Frameworks

The following frameworks support build output caching:

| Framework | Directories cached |
| ---------- | --------------------------------------------- |
| Astro | `node_modules/.astro` |
| Docusaurus | `node_modules/.cache`, `.docusaurus`, `build` |
| Eleventy | `.cache` |
| Gatsby | `.cache`, `public` |
| Next.js | `.next/cache` |
| Nuxt | `node_modules/.cache/nuxt` |

:::note
[Static assets](/workers/static-assets/) and [frameworks](/workers/frameworks/) are now supported in Cloudflare Workers.
:::

## Limits

The following limits are imposed for build caching:

- **Retention**: Cache is purged 7 days after its last read date. Unread cache artifacts are purged 7 days after creation.
- **Storage**: Every project is allocated 10 GB. If the project cache exceeds this limit, the project will automatically start deleting artifacts that were read least recently.
61 changes: 61 additions & 0 deletions src/content/docs/workers/ci-cd/builds/build-watch-paths.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
pcx_content_type: concept
title: Build watch paths
description: Reduce compute for your monorepo by specifying paths for Workers Builds to skip
sidebar:
order: 6
---

When you connect a git repository to Workers, by default a change to any file in the repository will trigger a build. You can configure Workers to include or exclude specific paths to specify if Workers should skip a build for a given path. This can be especially helpful if you are using a monorepo project structure and want to limit the amount of builds being kicked off.

## Configure paths

To configure which paths are included and excluded:

1. In **Overview**, select your Workers project.
2. Go to **Settings** > **Build** > **Build watch paths**. Workers will default to setting your project’s includes paths to everything (\[\*]) and excludes paths to nothing (`[]`).

The configuration fields can be filled in two ways:

- **Static filepaths**: Enter the precise name of the file you are looking to include or exclude (for example, `docs/README.md`).
- **Wildcard syntax:** Use wildcards to match multiple path directories. You can specify wildcards at the start or end of your rule.

:::note[Wildcard syntax]

A wildcard (`*`) is a character that is used within rules. It can be placed alone to match anything or placed at the start or end of a rule to allow for better control over branch configuration. A wildcard will match zero or more characters.For example, if you wanted to match all branches that started with `fix/` then you would create the rule `fix/*` to match strings like `fix/1`, `fix/bugs`or `fix/`.

:::

For each path in a push event, build watch paths will be evaluated as follows:

- Paths satisfying excludes conditions are ignored first
- Any remaining paths are checked against includes conditions
- If any matching path is found, a build is triggered. Otherwise the build is skipped

Workers will bypass the path matching for a push event and default to building the project if:

- A push event contains 0 file changes, in case a user pushes a empty push event to trigger a build
- A push event contains 3000+ file changes or 20+ commits

## Examples

### Example 1

If you want to trigger a build from all changes within a set of directories, such as all changes in the folders `project-a/` and `packages/`

- Include paths: `project-a/*, packages/*`
- Exclude paths: \`\`

### Example 2

If you want to trigger a build for any changes, but want to exclude changes to a certain directory, such as all changes in a docs/ directory

- Include paths: `*`
- Exclude paths: `docs/*`

### Example 3

If you want to trigger a build for a specific file or specific filetype, for example all files ending in `.md`.

- Include paths: `*.md`
- Exclude paths: \`\`
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pcx_content_type: concept
title: Limits & Pricing
description: Limits & pricing for Workers Builds
sidebar:
order: 6
order: 8
---

## Limits
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/workers/ci-cd/builds/troubleshoot.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pcx_content_type: troubleshooting
title: Troubleshooting
description: Learn about troubleshooting and known issues in Workers Builds.
sidebar:
order: 7
order: 9
---

Workers Builds provides build logs for every build started. You can view build logs by navigating to your **Worker project** > **Deployments** > **View Build History** > **View Build**.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,13 @@ To set up your CI/CD:

1. Go to your CI/CD platform and add the following as secrets:

<<<<<<< HEAD
- `CLOUDFLARE_ACCOUNT_ID`: Set to the [Cloudflare account ID](/workers/ci-cd/external-cicd/#cloudflare-account-id) for the account on which you want to deploy your Worker.
- `CLOUDFLARE_API_TOKEN`: Set to the [Cloudflare API token you generated](/workers/ci-cd/external-cicd/#api-token).
=======
- `CLOUDFLARE_ACCOUNT_ID`: Set to the [Cloudflare account ID](#cloudflare-account-id) for the account on which you want to deploy your Worker.
- `CLOUDFLARE_API_TOKEN`: Set to the [Cloudflare API token you generated](#api-token).
>>>>>>> 512d7f3090a82fbd18235a6ab7048a7378feb0e4

:::caution

Expand Down
Loading