50 lines
1.5 KiB
YAML
50 lines
1.5 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:
|
|
if: ${{ github.repository == 'github/docs-internal' && (github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success') }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out repo
|
|
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
|
|
|
|
- uses: ./.github/actions/node-npm-setup
|
|
|
|
- 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
|