This action uses Cloudflare's API to purge their cache of your site.
You can mix and match the various inputs however you want
(other than the zone and auth key). If you don't provide
files
or tags
or hosts
or prefixes
, then all files will be purged.
The zone ID of your Cloudflare site. Example:
023e105f4ecef8ad9ca31a8372d0c353
The Cloudflare API key you've generated for your zone. Example:
c2547eb745079dac9320b638f5e225cf483cc5cfdda41
A space separated list of URLs to purge. Example:
files: https://nathanv.me/assets/images/profile.png https://nathanv.me/assets/images/favicons/apple-touch-icon.png
The key urls
is also accepted for backwards compatibility.
A space separated list of tags to purge. Example:
tags: some-tag another-tag
A space separated list of hosts to purge. Example:
hosts: nathanv.me blog.nathanv.me
A space separated list of prefixes to purge. Example:
prefixes: nathanv.me/assets/ blog.nathanv.me/assets
None
- name: Purge cache
uses: nathanvaughn/actions-cloudflare-purge@master
# preferred
with:
cf_zone: ${{ secrets.CLOUDFLARE_ZONE }}
cf_auth: ${{ secrets.CLOUDFLARE_AUTH_KEY }}
- name: Purge cache
uses: nathanvaughn/actions-cloudflare-purge@master
# legacy
env:
CLOUDFLARE_ZONE: ${{ secrets.CLOUDFLARE_ZONE }}
CLOUDFLARE_AUTH_KEY: ${{ secrets.CLOUDFLARE_AUTH_KEY }}
- name: Purge cache
uses: nathanvaughn/actions-cloudflare-purge@master
with:
cf_zone: ${{ secrets.CLOUDFLARE_ZONE }}
cf_auth: ${{ secrets.CLOUDFLARE_AUTH_KEY }}
files: |
https://nathanv.me/assets/images/profile.png
https://nathanv.me/assets/images/favicons/apple-touch-icon.png
tags: |
some-tag
another-tag
hosts: |
nathanv.me
blog.nathanv.me
prefixes: |
nathanv.me/assets/
blog.nathanv.me/assets
- First, go to the API tokens page in your Cloudflare account.
- Click "Create Token", and fill out the form. Make sure to give the permission of zone cache purge.
-
Click "Continue to summary", then "Confirm".
-
Copy the value of the token.
- To find the zone ID for your site, go to your dashboard for the site, and look on the right-hand panel.
Follow GitHub's documentation to add these values to your repository's secrets.