From 861e74e03c032ca8131810a9bde500c7a7f8d009 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Mon, 9 Dec 2024 23:08:58 +0100 Subject: [PATCH] Auto-purge Cloudflare cache so changes show up sooner --- .github/workflows/hugo.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/hugo.yml b/.github/workflows/hugo.yml index 3911f93..a5ce8c1 100644 --- a/.github/workflows/hugo.yml +++ b/.github/workflows/hugo.yml @@ -54,3 +54,10 @@ jobs: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4 + + - name: Purge Cloudflare cache + run: | + curl -X POST "https://api.cloudflare.com/client/v4/zones/${{ secrets.CLOUDFLARE_ZONE_ID }}/purge_cache" \ + -H "Authorization: Bearer ${{ secrets.CLOUDFLARE_PURGE_TOKEN }}" \ + -H "Content-Type: application/json" \ + --data '{"purge_everything":true}'