mirror of
https://github.com/dataforcanada/d4c-service-main-site.git
synced 2026-06-13 14:00:51 +02:00
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:
@@ -5,6 +5,8 @@ on:
|
|||||||
- main
|
- main
|
||||||
paths:
|
paths:
|
||||||
- 'worker/*'
|
- '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.
|
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
|
||||||
concurrency:
|
concurrency:
|
||||||
@@ -23,4 +25,10 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN_WORKER }}
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN_WORKER }}
|
||||||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
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"]}'
|
||||||
|
|||||||
Reference in New Issue
Block a user