Skip to content

ci(deploy): fail loudly when Cloudflare cache purge fails - #63

Merged
Bissbert merged 1 commit into
mainfrom
chore/deploy-purge-hardening
Jul 20, 2026
Merged

ci(deploy): fail loudly when Cloudflare cache purge fails#63
Bissbert merged 1 commit into
mainfrom
chore/deploy-purge-hardening

Conversation

@Bissbert

Copy link
Copy Markdown
Contributor

Summary

  • The Purge Cloudflare Cache step used a bare curl and never checked the response - the Cloudflare purge API returns HTTP 200 even on auth failure, so a broken CLOUDFLARE_API_TOKEN silently left the edge cache un-invalidated on every deploy, serving stale content.
  • The step now parses the JSON success field via jq and exits 1 with a ::error:: annotation when purge fails, naming the likely fix (token needs Zone.Cache Purge:Edit).
  • The Cloudflare Pages deployment itself is a prior step and still completes; only the purge substep now surfaces the failure.

Test plan

  • Reviewed workflow YAML syntax
  • CI passes (build/lint/preview)
  • Post-merge deploy.yml run on main confirms build + deploy-to-Pages succeed, and purge step fails loudly with the expected code-10000 annotation until the token is regenerated

The Purge Cloudflare Cache step used a bare curl and never checked the
response - the Cloudflare purge API returns HTTP 200 even on auth
failure, so a broken CLOUDFLARE_API_TOKEN (currently: error code
10000) silently left the edge cache un-invalidated on every deploy,
serving stale content. The step now parses the JSON `success` field
via jq and exits 1 with a `::error::` annotation when purge fails,
naming the likely fix (token needs Zone.Cache Purge:Edit). The
Cloudflare Pages deployment itself is a prior step and still
completes; only the purge substep now surfaces the failure.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying gemmology-dev with  Cloudflare Pages  Cloudflare Pages

Latest commit: de24634
Status:🚫  Build failed.

View logs

@github-actions

Copy link
Copy Markdown

🚀 Preview deployed to: https://44ff5074.gemmology-dev.pages.dev

@Bissbert
Bissbert merged commit 607b2b0 into main Jul 20, 2026
5 of 6 checks passed
@Bissbert
Bissbert deleted the chore/deploy-purge-hardening branch July 20, 2026 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant