From 043b07d42b4a3274f372c4eb304be3093c21ef00 Mon Sep 17 00:00:00 2001 From: ludeeus Date: Sat, 14 Jan 2023 08:49:16 +0000 Subject: [PATCH] Purge cache on upload --- .github/workflows/upload-removed.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/upload-removed.yml b/.github/workflows/upload-removed.yml index 77f30dc..c9ac681 100644 --- a/.github/workflows/upload-removed.yml +++ b/.github/workflows/upload-removed.yml @@ -56,6 +56,14 @@ jobs: AWS_ACCESS_KEY_ID: ${{ secrets.CF_R2_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.CF_R2_SECRET_ACCESS_KEY }} + - name: Bust Cloudflare cache + run: | + curl --silent --show-error --fail -X POST \ + "https://api.cloudflare.com/client/v4/zones/${{ secrets.CF_ZONE_ID }}/purge_cache" \ + -H "Authorization: Bearer ${{ secrets.CF_BUST_CACHE_TOKEN }}" \ + -H "Content-Type: application/json" \ + --data '{"files": ["https:\/\/data-v2.hacs.xyz\/removed\/data.json", "https:\/\/data-v2.hacs.xyz\/removed\/repositories.json"]}' + - name: Discord notification if: ${{ github.event_name == 'schedule' && failure() }} run: |