Skip to content

Commit 57f7023

Browse files
committed
feat: purge cf cache
1 parent 6fed139 commit 57f7023

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

.circleci/config.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,22 @@ jobs:
2929
name: Deploy website and api-data to the correct environment (production/staging)
3030
command: sh scripts/deploy.sh
3131

32+
purge_cache:
33+
executor: node
34+
steps:
35+
- run:
36+
name: Purge Cloudflare cache
37+
command: |
38+
sleep 10
39+
curl https://api.cloudflare.com/client/v4/zones/1b447807502a801bdff3f71052fab25b/purge_cache \
40+
-H 'Content-Type: application/json' \
41+
-H "Authorization: Bearer $CF_POKEAPI_CIRCLECI_CACHE_PURGE_NARAMSIM" \
42+
-d '{
43+
"files": [
44+
"https://pokeapi.co/"
45+
]
46+
}'
47+
3248
workflows:
3349
version: 2
3450
commit:
@@ -42,3 +58,10 @@ workflows:
4258
only:
4359
- master
4460
- staging
61+
- purge_cache:
62+
requires:
63+
- deploy
64+
filters:
65+
branches:
66+
only:
67+
- master

0 commit comments

Comments
 (0)