Skip to content
play

GitHub Action

Cloudflare Purge Cache Action

v1.0.6 Pre-release

Cloudflare Purge Cache Action

play

Cloudflare Purge Cache Action

Purges cache on a cloudflare zone

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Cloudflare Purge Cache Action

uses: 3stacks/[email protected]

Learn more about this action in 3stacks/cloudflare-purge-cache-action

Choose a version

Cloudflare Purge Cache Action

This is a Github action. Read more about those here: https://developer.github.com/actions/

The default behaviour is to purge everything. If you don't want to blow your whole site cache away, make sure you define specific files using the fileList arg (ALPHA. DO NOT USE IN HIGH VALUE PIPELINES).

Usage

your-workflow.yml

    - name: Purge cache
      uses: 3stacks/[email protected]
      with:
        authToken: ${{ secrets.CLOUDFLARE_AUTH_TOKEN }}
        siteName: somesite.com
        authEmail: [email protected]
        fileList: <NOT YET OFFICIALLY SUPPORTED> "[\"http://somesite.com/index.html\",\"http://somesite.com/cat-picture.jpg\"]"

Arguments

All arguments are of type string.

Arg Name Required Default Value Description Reference
authToken Yes nil Generated on your user profile in Cloudflare. Store in secrets! https://api.cloudflare.com/#getting-started-requests
siteName Yes nil The name of the site/zone you're targeting
authEmail Yes nil The email associated with your Cloudflare account
fileList Yes nil This will be stringified JSON. See the format of files https://api.cloudflare.com/#zone-purge-files-by-url