Skip to content

Cloudflare Clear Cache #2

Cloudflare Clear Cache

Cloudflare Clear Cache #2

name: Cloudflare Clear Cache
on:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
jobs:
clear-cache:
name: Clear the Cloudflare cache
runs-on: ubuntu-latest
steps:
- name: Clear cache for release API
if: ${{ github.repository == 'bluehost/bluehost-wordpress-plugin' }}
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 '{"files":["https://hiive.cloud/workers/release-api/plugins/bluehost/bluehost-wordpress-plugin"]}'