diff --git a/.github/workflows/deploy_worker.yaml b/.github/workflows/deploy_worker.yaml index 6fc7436..f84fca2 100644 --- a/.github/workflows/deploy_worker.yaml +++ b/.github/workflows/deploy_worker.yaml @@ -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" \ No newline at end of file + 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"]}'