A GitHub Action that purges Cloudflare cache via API after deployments.
Cloudflare Purge Action is a GitHub Action that automatically clears Cloudflare's CDN cache via API calls. It solves the problem of stale content appearing after website deployments by integrating cache invalidation directly into CI/CD pipelines. The action provides a simple way to ensure visitors always see the latest version of your website.
Developers and DevOps teams using Cloudflare CDN who deploy websites via GitHub Actions and need automated cache management. This is particularly useful for static site generators, Jamstack applications, and any Cloudflare-protected websites with frequent updates.
Developers choose this action because it provides a reliable, officially-supported way to automate Cloudflare cache purging without writing custom scripts. It offers secure authentication options, supports both full and selective cache clearing, and integrates seamlessly into existing GitHub Actions workflows.
🗑️ GitHub Action to purge a website's cache via the Cloudflare API
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Fits seamlessly into existing GitHub Actions workflows with straightforward YAML configuration, as demonstrated in the example workflow file.
Uses GitHub Secrets for sensitive data and recommends restricted API tokens to minimize security risks, with clear setup instructions from the README.
Supports both full cache purge and selective URL-based purging via the PURGE_URLS variable, offering control over what gets invalidated.
Directly calls Cloudflare's documented API, ensuring compatibility and reducing the risk of breaking changes from unofficial methods.
Exclusively designed for Cloudflare CDN and GitHub Actions, making it unsuitable for other environments or CI/CD tools.
The README admits that purging folders requires listing every file unless on an expensive Enterprise plan, limiting efficiency for complex sites.
The action notes reliance on GitHub Actions beta in the README, which could lead to instability or changes that affect workflow reliability.