Skip to content

Merge pull request #328 from helium/develop #37

Merge pull request #328 from helium/develop

Merge pull request #328 from helium/develop #37

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"