Change GitHub action so it purges the Cloudflare cache for www.dataforcanada.org and enables running workflow manually from the Actions tab

This commit is contained in:
Diego Ripley
2025-06-26 18:16:26 -04:00
parent 8318bf53a4
commit d461939b1a
+9 -1
View File
@@ -5,6 +5,8 @@ on:
- main
paths:
- 'worker/*'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
concurrency:
@@ -23,4 +25,10 @@ jobs:
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN_WORKER }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
workingDirectory: "worker"
workingDirectory: "worker"
- name: Purge Cloudflare cache
run: |
curl --location 'https://api.cloudflare.com/client/v4/zones/${{ secrets.CLOUDFLARE_ZONE_ID }}/purge_cache' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer ${{ secrets.CLOUDFLARE_API_TOKEN_PURGE_CACHE }}' \
--data '{"hosts": ["www.dataforcanada.org"]}'