Skip to content

Purge Cloudflare Cache #16

Purge Cloudflare Cache

Purge Cloudflare Cache #16

Workflow file for this run

name: Purge Cloudflare Cache
on:
workflow_run:
workflows: ["Deploy to GitHub Pages"]
types:
- completed
branches:
- main
jobs:
purge-cache:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Purge Cloudflare cache
run: |
curl -X POST "https://api.cloudflare.com/client/v4/zones/${{ secrets.CLOUDFLARE_ZONE_ID }}/purge_cache" \
-H "Authorization: Bearer ${{ secrets.CLOUDFLARE_API_TOKEN }}" \
-H "Content-Type: application/json" \
--data '{"purge_everything":true}'