Skip to content

Purge Cloudflare cache #112

Purge Cloudflare cache

Purge Cloudflare cache #112

name: Purge Cloudflare cache
on:
workflow_run:
workflows: [pages-build-deployment]
types: [completed]
branches: [main]
jobs:
purge:
runs-on: ubuntu-latest
steps:
- name: Purge Cloudflare cache
env:
CLOUDFLARE_ZONE_ID: ${{ secrets.CLOUDFLARE_ZONE_ID }}
CLOUDFLARE_AUTH_EMAIL: ${{ secrets.CLOUDFLARE_AUTH_EMAIL }}
CLOUDFLARE_AUTH_KEY: ${{ secrets.CLOUDFLARE_AUTH_KEY }}
run: |
curl -X POST "https://api.cloudflare.com/client/v4/zones/$CLOUDFLARE_ZONE_ID/purge_cache" \
-H "X-Auth-Email: $CLOUDFLARE_AUTH_EMAIL" \
-H "X-Auth-Key: $CLOUDFLARE_AUTH_KEY" \
-H "Content-Type: application/json" \
--data '{"purge_everything":true}'