-
-
Notifications
You must be signed in to change notification settings - Fork 672
28 lines (25 loc) · 725 Bytes
/
purge-cache.yml
File metadata and controls
28 lines (25 loc) · 725 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
name: Purge Fastly Cache
on:
push:
branches: [main]
paths: ['static/**', 'templates/**', '**/templates/**']
workflow_dispatch:
inputs:
target:
description: 'Surrogate key to purge'
required: true
default: 'pydotorg-app'
type: choice
options: [pydotorg-app, downloads, events, sponsors, jobs]
permissions: {}
jobs:
purge:
runs-on: ubuntu-latest
env:
KEY: ${{ inputs.target || 'pydotorg-app' }}
steps:
- name: Purge ${{ env.KEY }}
run: |
curl -fsS -X POST \
"https://api.fastly.com/service/${{ secrets.FASTLY_SERVICE_ID }}/purge/${{ env.KEY }}" \
-H "Fastly-Key: ${{ secrets.FASTLY_API_KEY }}"