From e39b10fdfc17e785ee1fc9541431f3bba7241563 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Tue, 30 Sep 2025 16:49:57 +0200 Subject: [PATCH] Add a GitHub workflow cache to manually purge the Cloudflare cache We had problems with the cache-purging logic in https://github.com/git/git-scm.com/issues/2086, and then also in https://github.com/git/git-scm.com/issues/2093. The symptom is that the CSS isn't loading, because the front-page still serves an older version (one that references a no-longer-existing CSS). The culprit seems to be the un-purged Cloudflare cache. Let's add a way to manually purge the cache. It is totally possible that this is one of those famous "Close Door" elevator buttons that fool us: https://www.sciencealert.com/the-close-door-buttons-in-elevators-don-t-actually-do-anything But in case it isn't, let's have a way to trigger a purge. Signed-off-by: Johannes Schindelin --- .github/workflows/purge-cache.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/purge-cache.yml diff --git a/.github/workflows/purge-cache.yml b/.github/workflows/purge-cache.yml new file mode 100644 index 0000000000..5d6b3eaaf3 --- /dev/null +++ b/.github/workflows/purge-cache.yml @@ -0,0 +1,25 @@ +name: Purge Cloudflare Cache + +on: + workflow_dispatch: + +jobs: + purge-cache: + concurrency: + group: "purge-cache" + cancel-in-progress: false + runs-on: ubuntu-latest + steps: + - name: Purge Cloudflare cache + shell: bash + env: + CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }} + CLOUDFLARE_ZONE: ${{ secrets.CLOUDFLARE_ZONE }} + if: env.CLOUDFLARE_TOKEN != '' + run: | + curl "https://api.cloudflare.com/client/v4/zones/$CLOUDFLARE_ZONE/purge_cache" \ + -H "Authorization: Bearer $CLOUDFLARE_TOKEN" \ + -H "Content-Type: application/json" \ + -d '{ "purge_everything": true }' + +