INTEGRITY Cloudflare Docs

Branch deployment controls

When connected to your git repository, Pages allows you to control which environments and branches you would like to automatically deploy to. By default, Pages will trigger a deployment any time you commit to either your production or preview environment. However, with branch deployment controls, you can configure automatic deployments to suit your preference on a per project basis.

Production branch control

To configure deployment options, go to your Pages project > Settings > Builds & deployments > Configure Production deployments. Pages will default to setting your production environment to the branch you first push, but you can set your production to another branch if you choose.

You can also enable or disable automatic deployment behavior on the production branch by checking the Enable automatic production branch deployments box. You must save your settings in order for the new production branch controls to take effect.

Preview branch control

When configuring automatic preview deployments, there are three options to choose from.

Custom preview branch control

By selecting Custom branches, you can specify branches you wish to include and exclude from automatic deployments in the provided configuration fields. The configuration fields can be filled in two ways:

Example 1:

If you want to enforce branch prefixes such as fix/, feat/, or chore/ with wildcard syntax, you can include and exclude certain branches with the following rules:

Here Pages will include any branches with the indicated prefixes and exclude everything else. In this example, the excluding option is left empty.

Example 2:

If you wanted to prevent dependabot from creating a deployment for each PR it creates, you can exclude those branches with the following:

Here Pages will include all branches except any branch starting with dependabot. In this example, the excluding option means any dependabot/ branches will not be built.

Example 3:

If you only want to deploy release-prefixed branches, then you could use the following rules:

This will deploy only branches starting with release/.