github: Purge Cloudflare cache upon pipeline completion

Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
This commit is contained in:
Harsh Shandilya 2019-11-06 09:35:01 +05:30
parent c727cf25ad
commit 67867021f3
1 changed files with 7 additions and 0 deletions

View File

@ -61,3 +61,10 @@ jobs:
SERVER_ADDRESS: ${{ secrets.SERVER_ADDRESS }}
SERVER_DESTINATION: ${{ secrets.SERVER_DESTINATION_PROD }}
SSH_PORT: ${{ secrets.SSH_PORT }}
- name: Purge Cloudflare cache
run: |
curl -s -X POST "https://api.cloudflare.com/client/v4/zones/${CF_ZONE_ID}/purge_cache" -H "X-Auth-Email: msfjarvis@gmail.com" -H "X-Auth-Key: ${CF_API_KEY}" -H "Content-Type: application/json" --data '{"purge_everything":true}'
env:
CF_API_KEY: ${{ secrets.CLOUDFLARE_API_KEY }}
CF_ZONE_ID: ${{ secrets.CLOUDFLARE_ZONE_ID }}