Purge Cloudflare cache for a zone or list of zones with optional file/url filter.
For more details see: action.yaml and src/main.py.
input | required | default | description |
---|---|---|---|
token | Yes | - | Cloudflare API Token |
zones | Yes | - | Zone Names to Purge * |
files | - | - | Files to Purge * |
prefix | - | - | Prefix Prepended to Files * |
tags | - | - | Tags to Purge (Enterprise only) * |
hosts | - | - | Hosts to Purge (Enterprise only) * |
prefixes | - | - | Prefixes to Purge (Enterprise only) * |
fail | - | all |
Fail Mode: [all , any , none ] |
summary | - | true |
Add Summary to Job * |
dry_run | - | false |
Run Without Purging |
zones - CSV or Newline Delimited list of zone names to purge.
files - CSV or Newline Delimited list of files to purge. This is limited to 30 files on the free plan and 500 for enterprise. For more information view docs for purge by file.
prefix - If provided, the prefix
will be prepended to all the files
. Useful for generating full links from file paths.
tags/hosts/prefixes - Enterprise only. CSV or Newline Delimited list of tags
, hosts
or prefixes
to purge.
For more information view docs for purge by
tags,
hostname,
prefix.
summary - Write a Summary for the job. To disable this set to false
.
👀 View Example Job Summary
dry_run
to purge cache.
Purge Results
🚽 | Zone |
---|---|
✅ | cssnr.com |
⛔ | example.com |
Inputs
zones: cssnr.com,example.com
files:
prefix:
tags:
hosts:
prefixes:
fail: all
summary: true
dry_run: true
With minimal inputs, this will purge everything:
- name: 'Purge Cache Action'
uses: cssnr/cloudflare-purge-cache-action@v2
with:
token: ${{ secrets.CLOUDFLARE_API_TOKEN }}
zones: cssnr.com,example.com
To limit what is purged, specify either files
, tags
, hosts
, or prefixes
.
With all inputs:
- name: 'Purge Cache Action'
uses: cssnr/cloudflare-purge-cache-action@v2
with:
token: ${{ secrets.CLOUDFLARE_API_TOKEN }}
zones: cssnr.com
files: |
favicon.ico
static/logo.png
prefix: 'https://cssnr.com/'
tags: prod, dev
hosts: example.com, dev.example.com
prefixes: |
example.com
example.com/foo
fail: all
summary: true
dry_run: false
output | description |
---|---|
success | Successful Zones, CSV |
failed | Failed Zones, CSV |
- name: 'Purge Cache Action'
id: purge
uses: cssnr/cloudflare-purge-cache-action@v2
with:
token: ${{ secrets.CLOUDFLARE_API_TOKEN }}
zones: cssnr.com,example.com
- name: 'Echo Output'
run: |
echo "success: '${{ steps.purge.outputs.success }}'"
echo "failed: '${{ steps.purge.outputs.failed }}'"
name: 'Cloudflare Purge Cache'
on:
push:
jobs:
test:
name: 'Test'
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: 'Purge Cache Action'
uses: cssnr/cloudflare-purge-cache-action@v2
with:
token: ${{ secrets.CLOUDFLARE_API_TOKEN }}
zones: |
cssnr.com
example.com
The following rolling tags are maintained.
You can view the release notes for each version on the releases page.
For general help or to request a feature, see:
- Q&A Discussion: https://github.com/cssnr/cloudflare-purge-cache-action/discussions/categories/q-a
- Request a Feature: https://github.com/cssnr/cloudflare-purge-cache-action/discussions/categories/feature-requests
If you are experiencing an issue/bug or getting unexpected results, you can:
- Report an Issue: https://github.com/cssnr/cloudflare-purge-cache-action/issues
- Chat with us on Discord: https://discord.gg/wXy6m2X8wY
- Provide General Feedback: https://cssnr.github.io/feedback/
Currently, the best way to contribute to this project is to star this project on GitHub.
If you would like to submit a PR, please review the CONTRIBUTING.md.
Additionally, you can support other GitHub Actions I have published:
- Stack Deploy Action
- Portainer Stack Deploy
- VirusTotal Action
- Mirror Repository Action
- Update Version Tags Action
- Update JSON Value Action
- Parse Issue Form Action
- Cloudflare Purge Cache Action
- Mozilla Addon Update Action
- Docker Tags Action
For a full list of current projects to support visit: https://cssnr.github.io/