-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
purge Cloudflare cache after deployments
- Loading branch information
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
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
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 }' |