Purge Cloudflare cache #5017
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Purge Cloudflare cache | |
on: | |
deployment_status: | |
workflow_dispatch: | |
jobs: | |
purge-cache: | |
if: github.event_name == 'workflow_dispatch' || (github.event.deployment_status.state == 'success' && github.event.deployment_status.environment == 'Production – guild-xyz') | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clear Cloudflare cache | |
run: curl --request POST --url https://api.cloudflare.com/client/v4/zones/${{secrets.CLOUDFLARE_ZONE_ID}}/purge_cache --header 'Content-Type:application/json' --header 'X-Auth-Email:${{secrets.CLOUDFLARE_X_AUTH_EMAIL}}' --header 'X-Auth-Key:${{secrets.CLOUDFLARE_X_AUTH_KEY}}' --data '{"purge_everything":true}' |