name: Purge CDN cache

on: page_build

jobs:
  purge:

    runs-on: ubuntu-latest

    steps:
      - name: Purge Cloudflare cache
        run: |
          curl "https://api.cloudflare.com/client/v4/zones/${{ secrets.CLOUDFLARE_ZONE }}/purge_cache" \
            -H "Authorization: Bearer ${{ secrets.CLOUDFLARE_PURGE_CACHE_TOKEN }}" \
            -H "Content-Type: application/json" \
            --data '{"purge_everything": true}'

name: Purge CDN cache

on: page_build

jobs:
  purge:

    runs-on: ubuntu-latest

    steps:
      - name: Purge Cloudflare cache
        run: |
          curl "https://api.cloudflare.com/client/v4/zones/${{ secrets.CLOUDFLARE_ZONE }}/purge_cache" \
            -H "Authorization: Bearer ${{ secrets.CLOUDFLARE_PURGE_CACHE_TOKEN }}" \
            -H "Content-Type: application/json" \
            --data '{"purge_everything": true}' \
            --fail

Make curl return with non-zero exit code on errors
Make curl return with non-zero exit code on errors
