Skip to content

Commit 6d1e914

Browse files
hackall360claude
andcommitted
Feat: Add automatic Cloudflare cache purge to deployment
- Purge Cloudflare cache after each deployment - Requires CLOUDFLARE_ZONE_ID and CLOUDFLARE_API_TOKEN secrets - Eliminates manual cache purging after deployments 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 29dd157 commit 6d1e914

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,21 @@ jobs:
167167
user_email: 'github-actions[bot]@users.noreply.github.com'
168168
commit_message: 'Deploy from main branch'
169169

170+
- name: Purge Cloudflare cache
171+
run: |
172+
echo "🧹 Purging Cloudflare cache..."
173+
curl -s -X POST "https://api.cloudflare.com/client/v4/zones/${{ secrets.CLOUDFLARE_ZONE_ID }}/purge_cache" \
174+
-H "Authorization: Bearer ${{ secrets.CLOUDFLARE_API_TOKEN }}" \
175+
-H "Content-Type: application/json" \
176+
--data '{"purge_everything":true}' | jq .
177+
echo "✅ Cache purge requested"
178+
170179
- name: Report deployment success
171180
run: |
172181
echo "🚀 DEPLOYMENT SUCCESSFUL"
173182
echo "================================"
174183
echo "Branch: ${{ github.ref_name }}"
175184
echo "URL: https://www.unityailab.com/"
176185
echo "Built with: Vite (optimized)"
186+
echo "Cache: Purged via Cloudflare API"
177187
echo "================================"

0 commit comments

Comments
 (0)