Skip to content

Commit d21bec0

Browse files
committed
feat(workflow): add Cloudflare cache purge after S3 deployment
Add cache purge step to clear Cloudflare cache when website is deployed to S3. Uses CLOUDFLARE_ZONE_ID and CLOUDFLARE_API_TOKEN secrets for API authentication.
1 parent 3cf2879 commit d21bec0

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

.github/workflows/workflow.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,10 @@ jobs:
4242
AWS_SECRET_ACCESS_KEY: ${{ secrets.ONION_AWS_SECRET_ACCESS_KEY }}
4343
AWS_REGION: ${{ secrets.ONION_AWS_REGION }}
4444
SOURCE_DIR: 'onion.makeitwork.cloud/'
45+
46+
- name: Purge Cloudflare Cache
47+
run: |
48+
curl -X POST "https://api.cloudflare.com/client/v4/zones/${{ secrets.CLOUDFLARE_ZONE_ID }}/purge_cache" \
49+
-H "Authorization: Bearer ${{ secrets.CLOUDFLARE_API_TOKEN }}" \
50+
-H "Content-Type: application/json" \
51+
--data '{"purge_everything":true}'

0 commit comments

Comments
 (0)