Skip to content

Commit 58c64ae

Browse files
committed
(maybe) add purge action
1 parent d8a0002 commit 58c64ae

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

.github/workflows/purge-cache.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Purge Fastly Cache
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths: ['static/**', 'sass/**', 'templates/**', '**/templates/**']
7+
workflow_dispatch:
8+
inputs:
9+
target:
10+
description: 'Surrogate key to purge'
11+
required: true
12+
default: 'pydotorg-app'
13+
type: choice
14+
options: [pydotorg-app, downloads, events, sponsors, jobs]
15+
16+
jobs:
17+
purge:
18+
runs-on: ubuntu-latest
19+
env:
20+
KEY: ${{ inputs.target || 'pydotorg-app' }}
21+
steps:
22+
- name: Purge ${{ env.KEY }}
23+
run: |
24+
curl -fsS -X POST \
25+
"https://api.fastly.com/service/${{ secrets.FASTLY_SERVICE_ID }}/purge/$KEY" \
26+
-H "Fastly-Key: ${{ secrets.FASTLY_API_KEY }}"

0 commit comments

Comments
 (0)