56 lines
1.6 KiB
YAML
56 lines
1.6 KiB
YAML
name: Purge Fastly
|
|
|
|
# **What it does**: Sends a soft-purge to Fastly.
|
|
# **Why we have it**: So that, right after a production deploy, we start afresh
|
|
# **Who does it impact**: Writers and engineers.
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
nuke_all:
|
|
description: "Nuke all 'every-deployment' keys independent of language"
|
|
required: false
|
|
type: boolean
|
|
default: false
|
|
languages:
|
|
description: "Comma separated languages. E.g. 'en,ja, es' (defaults to all)"
|
|
required: false
|
|
default: ''
|
|
workflow_run:
|
|
workflows: ['Azure Production - Build and Deploy']
|
|
types:
|
|
- completed
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
env:
|
|
FASTLY_TOKEN: ${{ secrets.FASTLY_TOKEN }}
|
|
FASTLY_SERVICE_ID: ${{ secrets.FASTLY_SERVICE_ID }}
|
|
|
|
jobs:
|
|
send-purges:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out repo
|
|
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
|
|
|
|
- name: Setup node
|
|
uses: actions/setup-node@17f8bd926464a1afa4c6a11669539e9c1ba77048
|
|
with:
|
|
node-version: '16.17.0'
|
|
cache: npm
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Purge Fastly edge cache independent of language
|
|
if: ${{ github.event.inputs.nuke_all }}
|
|
run: .github/actions-scripts/purge-fastly-edge-cache.js
|
|
|
|
- name: Purge Fastly edge cache per language
|
|
if: ${{ !github.event.inputs.nuke_all }}
|
|
env:
|
|
LANGUAGES: ${{ github.event.inputs.languages }}
|
|
run: .github/actions-scripts/purge-fastly-edge-cache-per-language.js
|