Skip to content

Commit

Permalink
test: purge cache after cf deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
KhafraDev committed Mar 10, 2024
1 parent cae1a86 commit fe0af87
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/purge-cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Purge Cache After Deploy
on:
push:
branches: master

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
steps:
- uses: actions/checkout@v3
- name: Wait for CF Pages
id: cf-pages
uses: WalshyDev/cf-pages-await@v1
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: 'bd22ac056a23329365c8a57927490701'
project: 'synergism'
# Add this if you want GitHub Deployments (see below)
githubToken: ${{ secrets.API_TOKEN_GITHUB }}
- run: |
curl -X \
-H "Authorization: ${{ secrets.CF_API_TOKEN }}" \
-H "Content-Type: application/json" \
--data '{"purge_everything":true}' \
https://api.cloudflare.com/client/v4/zones/418cbe6ba02822b5065295e82b6b2ea9/purge_cache

0 comments on commit fe0af87

Please sign in to comment.