Skip to content

yukukotani/fastly-purge-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

fastly-purge-action

A GitHub Actions to purge Fastly cache.

Usage

Puge by surrogate key

- name: Purge Fastly cache
  uses: yukukotani/fastly-purge-action@v1
  with:
    api-token: YOUR_TOKEN_HERE
    service-id: 4UiI4ODITcAJv2z4ezJTFC
    target: surrogate-key,another-key
    keys: landing-pages
    soft: true

Purge by single url

- name: Purge Fastly cache
  uses: yukukotani/fastly-purge-action@v1
  with:
    api-token: YOUR_TOKEN_HERE
    target: single-url
    url: "https://example.com/some/page"
    soft: true

Options

api-token

Required

Your API token of Fastly. See here for details.

target

Required

The target to purge. Currently, only surrogate-key and single-url are supported. all will be supported if anyone requests.

service-id

Required when the target is surrogate-key

Your service id to purge caches. This is not service name. This will be a random alphanumeric string.

keys

Required when the target is surrogate-key

Surrogate Keys to purge. If you want to purge multiple keys, separate them with a comma.

url

Required when the target is single-url

soft

True by default. If false, the affected object will be inaccessible rather than marked as stale.