Skip to content

Commit

Permalink
purge Cloudflare cache after deployments
Browse files Browse the repository at this point in the history
  • Loading branch information
bates64 authored Sep 26, 2023
1 parent 0af45e2 commit 5d36957
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Deploy

on:
push:
branches:
- main

jobs:
purge_cache:
name: Purge Cloudflare cache
runs-on: ubuntu-latest
steps:
- name: Sleep to allow Pages to build
run: sleep 60
- name: Purge cache
run: |
curl --request POST \
--url https://api.cloudflare.com/client/v4/zones/2ab0c67ef74c8cb12474c3f7d76b1ac1/purge_cache \
--header 'Authorization: Bearer ${{ secrets.CLOUDFLARE_API_TOKEN }}' \
--data '{ "purge_everything": true }'

0 comments on commit 5d36957

Please sign in to comment.