Merge pull request #328 from helium/develop #37
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: Invalidate Cloudflare Cache for Web Prod | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'manifests/web-cluster/prod/helium/metadata.yaml' | |
jobs: | |
purge-cloudflare-cache: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Purge Cloudflare Cache for Web Prod | |
run: | | |
ZONE_ID="${{ secrets.WEB_PROD_CLOUDFLARE_ZONE_ID }}" | |
API_TOKEN="${{ secrets.WEB_PROD_CLOUDFLARE_API_TOKEN }}" | |
ENDPOINT="https://api.cloudflare.com/client/v4/zones/$ZONE_ID/purge_cache" | |
DATA='{"purge_everything":true}' | |
response=$(curl -X POST "$ENDPOINT" \ | |
-H "Authorization: Bearer $API_TOKEN" \ | |
-H "Content-Type: application/json" \ | |
--data "$DATA") | |
echo "Response: $response" |