Purge content from QuantCDN using GitHub Actions. Supports purging by URL pattern or by cache key.
Drop a step into any workflow under .github/workflows/:
- name: Purge cache after deploy
uses: quantcdn/purge-action@v7
with:
customer: ${{ secrets.QUANT_CUSTOMER }}
project: my-project
token: ${{ secrets.QUANT_TOKEN }}
url_pattern: /*QUANT_TOKEN should be configured as a repository secret.
Use url_pattern to purge by path. /* purges everything in the project.
- uses: quantcdn/purge-action@v7
with:
customer: ${{ secrets.QUANT_CUSTOMER }}
project: my-project
token: ${{ secrets.QUANT_TOKEN }}
url_pattern: /blog/*Use cache_keys to purge by one or more cache keys (space-separated). This requires that your origin emits a Cache-Keys header on cached responses. Keys are exact-match and are automatically scoped per project — there is no risk of colliding with another customer's cache.
- uses: quantcdn/purge-action@v7
with:
customer: ${{ secrets.QUANT_CUSTOMER }}
project: my-project
token: ${{ secrets.QUANT_TOKEN }}
cache_keys: env:testMultiple keys in a single step:
- uses: quantcdn/purge-action@v7
with:
customer: ${{ secrets.QUANT_CUSTOMER }}
project: my-project
token: ${{ secrets.QUANT_TOKEN }}
cache_keys: env:test release:1.4.2If a single QuantCDN project hosts multiple environments (e.g. test.example.com and www.example.com), have each environment's origin emit an environment-identifying cache key:
# Test responses
Cache-Keys: env:test
# Production responses
Cache-Keys: env:production
Then your post-deploy workflow can purge just the environment that was deployed:
- name: Purge test environment cache
if: github.ref == 'refs/heads/develop'
uses: quantcdn/purge-action@v7
with:
customer: ${{ secrets.QUANT_CUSTOMER }}
project: my-project
token: ${{ secrets.QUANT_TOKEN }}
cache_keys: env:test
- name: Purge production environment cache
if: github.ref == 'refs/heads/main'
uses: quantcdn/purge-action@v7
with:
customer: ${{ secrets.QUANT_CUSTOMER }}
project: my-project
token: ${{ secrets.QUANT_TOKEN }}
cache_keys: env:productionSet soft_purge: true to mark content as stale rather than evicting it immediately. Clients still receive cached content until the origin returns a fresh response.
- uses: quantcdn/purge-action@v7
with:
customer: ${{ secrets.QUANT_CUSTOMER }}
project: my-project
token: ${{ secrets.QUANT_TOKEN }}
cache_keys: env:test
soft_purge: true| Name | Required | Default | Description |
|---|---|---|---|
customer |
yes | — | Your customer account name |
project |
yes | — | Your project name |
token |
yes | — | Your API token |
url_pattern |
one of url_pattern or cache_keys |
"" |
URL path pattern to purge (use /* to purge everything) |
cache_keys |
one of url_pattern or cache_keys |
"" |
Space-separated cache keys to purge |
soft_purge |
no | false |
Mark stale instead of immediate eviction |
endpoint |
no | https://api.quantcdn.io/v1 |
QuantCDN API endpoint |
url_pattern and cache_keys are mutually exclusive — provide exactly one per step. To do both, run two steps.
- Purges are processed asynchronously and typically complete within a few seconds.
- Cache key matching is exact, not wildcard.
env:testpurges everything taggedenv:test, butenv:is not treated as a prefix.