Skip to content

Commit 42493b2

Browse files
committed
Add a GitHub workflow cache to manually purge the Cloudflare cache
We had problems with the cache-purging logic in #2086, and then also in #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 <[email protected]>
1 parent 67c948e commit 42493b2

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

.github/workflows/purge-cache.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Purge Cloudflare Cache
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
purge-cache:
8+
concurrency:
9+
group: "purge-cache"
10+
cancel-in-progress: false
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Purge Cloudflare cache
14+
shell: bash
15+
env:
16+
CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }}
17+
CLOUDFLARE_ZONE: ${{ secrets.CLOUDFLARE_ZONE }}
18+
${{ inputs.cloudflare-zone }}
19+
${{ inputs.cloudflare-token }}
20+
if: env.CLOUDFLARE_TOKEN != ''
21+
run: |
22+
curl "https://api.cloudflare.com/client/v4/zones/$CLOUDFLARE_ZONE/purge_cache" \
23+
-H "Authorization: Bearer $CLOUDFLARE_TOKEN" \
24+
-H "Content-Type: application/json" \
25+
-d '{ "purge_everything": true }'
26+
27+

0 commit comments

Comments
 (0)