Purge CF Cache #334
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 CF Cache | |
on: | |
deployment_status: | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
purge_cache: | |
name: Purge CF Cache | |
runs-on: ubuntu-latest | |
if: ${{ github.event.deployment_status.state == 'success' && github.event.deployment_status.environment == 'Production' }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Call CF | |
run: | | |
curl -X POST https://api.cloudflare.com/client/v4/zones/${{ secrets.CF_ZONE_ID }}/purge_cache \ | |
-d '{"purge_everything":true}' \ | |
-H "Content-Type: application/json" \ | |
-H "Authorization: Bearer ${{ secrets.CF_AUTH_KEY }}" \ |