Skip to content

Tina CMS First Blog Post created via CMS

Published: at 06:30 PMSuggest Changes

Table of Contents

Open Table of Contents

Production branch control

Direct Upload

If your project is a Direct Upload project, you will not have the option to configure production branch controls. To update your production branch, you will need to manually call the Update Project endpoint in the API.

Terminal windowcurl —request PATCH \“https://api.cloudflare.com/client/v4/accounts/{account_id}/pages/projects/{project_name}” \—header “Authorization: Bearer <API_TOKEN>” \—header “Content-Type: application/json” \—data ”{\“production_branch\”: \“main\”}”

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:

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/bugsor fix/.

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/.


Next Post
How to configure AstroPaper theme