YAML for Cloudflare

View as Markdown

Invalidate Cloudflare CDN cache to serve updated content.

YAML parameters for Cloudflare

PARAMETERS
integrationrequiredstring
Cloudflare integration (CLOUDFLARE). It refers to an integration in the workspace by its identifier, not by its display name.
zonerequiredstring
The Cloudflare zone name
typerequiredstring

Value: CLOUDFLARE

actionrequiredstring
Unique identifier for the action within the pipeline.
hostsstring[]
Hosts specifying objects to invalidate. Only one of paths, prefixes, tags and hosts can be set
prefixesstring[]
Prefixes specifying objects to invalidate, given without the host – the zone host is prepended automatically. Only one of paths, prefixes, tags and hosts can be set
tagsstring[]
Tags specifying objects to invalidate. Only one of paths, prefixes, tags and hosts can be set
base_urlstring
The base URL for the Cloudflare zone
purge_allboolean
If set to true, all cached content will be purged. When false, the action purges the objects listed in the definition, or - if no list is given - the files from the changeset. Purging the changeset needs a pipeline with refs; in a pipeline without refs set purge_all: true or list the objects to purge
local_pathstring
The path to the local files to invalidate
deployment_excludesstring[]
The list of files or directories to exclude from cache invalidation
deployment_includesstring[]
The list of files or directories to include in cache invalidation
pathsstring[]
The fixed list of paths to invalidate. The changeset is not computed when the list is set, so the pipeline needs no refs
input_typestring enum
The source of files to invalidate. Required only when purging by changeset, that is when purge_all is false and no objects to purge are given
Allowed enum:
SCM_REPOSITORY,
BUILD_ARTIFACTS
trigger_timestring enum
Specifies when the action should be executed. ON_SUCCESS actions run after every successful run, also one ended by an EARLY_EXIT action.
Allowed enum:
ON_EVERY_EXECUTION,
ON_SUCCESS,
ON_FAILURE,
ON_BACK_TO_SUCCESS,
ON_WARNING,
ON_WAIT_FOR_APPROVE,
ON_TERMINATE
loopstring[]
Names of the variables to loop over (IMAGES, not $IMAGES and not a value). The action runs once for each item of the value, and once for each combination of items when several variables are listed. The variable value is split into items by new lines, or by commas when it has no new lines (a single-line JSON object or key=value pairs stays one item). An item that is a JSON object or key=value pairs also sets one variable per key, named <VARIABLE>_<key>; an item that starts with EXTRACT: sets them as plain <key>.
run_only_on_first_failureboolean
When true, the action runs only on the first failure instead of on each failure. Used only when trigger_time is ON_FAILURE.
disabledboolean
When set to true the action is disabled. By default it is set to false.
timeoutinteger
The timeout in seconds. It cannot exceed the action time limit of the workspace plan; a higher value is rejected.
ignore_errorsboolean
If set to true the execution will proceed, mark action as a warning and jump to the next action. Doesn't apply to deployment actions.
retry_intervalinteger
Delay time between auto retries in seconds.
retry_countinteger
Number of retries if the action fails.

Constraints: ≤ 10

run_nextstring enum
Defines whether the action should run in parallel with the next one.
Allowed enum:
WAIT_ON_SUCCESS,
IN_SOFT_PARALLEL,
IN_HARD_PARALLEL
trigger_conditionsTriggerConditionYaml[]
The list of trigger conditions to meet so that the action can be triggered.
variablesVariableYaml[]
The list of variables you can use in the action.

Last modified on Nov 19, 2026

YAML examples for Cloudflare

Cloudflare cache invalidation

yaml
- action: Cloudflare action
  type: CLOUDFLARE
  trigger_time: ON_EVERY_EXECUTION
  disabled: false
  integration: "my-cloudflare-integration"
  input_type: SCM_REPOSITORY
  local_path: /
  base_url: https://buddy.works
  purge_all: false
  deployment_excludes:
    - /tmp
    - '*.log'
  deployment_includes:
    - /tmp/assets
    - /tmp/styles
  zone: buddy.works
  ignore_errors: false

Purge all Cloudflare cache

yaml
- action: Cloudflare purge all
  type: CLOUDFLARE
  trigger_time: ON_EVERY_EXECUTION
  disabled: false
  integration: "my-cloudflare-integration"
  purge_all: true
  zone: my-zone
  ignore_errors: false

Purge cache by fixed paths

yaml
- action: "Purge cache at aron.recipes"
  type: "CLOUDFLARE"
  purge_all: false
  paths:
    - "ccs/styles.css"
    - "cat_picture.jpg"
  integration: "cloudflare"
  zone: "buddy.recipes"
  base_url: "https://aron.recipes"

Purge cache by URL prefixes

yaml
- action: "Purge static assets"
  type: "CLOUDFLARE"
  integration: "cloudflare"
  zone: "buddy.recipes"
  prefixes:
    - "/static/"
    - "/images/"

Purge cache by cache tags

yaml
- action: "Purge tagged content"
  type: "CLOUDFLARE"
  integration: "cloudflare"
  zone: "buddy.recipes"
  tags:
    - "homepage"
    - "product-list"

Purge cache by hostnames

yaml
- action: "Purge hosts"
  type: "CLOUDFLARE"
  integration: "cloudflare"
  zone: "buddy.recipes"
  hosts:
    - "www.buddy.recipes"
    - "images.buddy.recipes"