Purge cache of Cloudflare CDN #520
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Purge cache of Cloudflare CDN" | |
on: | |
check_run: | |
types: | |
- completed | |
jobs: | |
trigger: | |
if: ${{ github.event.check_run.name == 'Cloudflare Pages' && github.event.check_run.conclusion == 'success' && github.event.check_run.head_sha == github.sha && github.ref == 'refs/heads/main' && github.repository_owner == 'xicri' }} | |
timeout-minutes: 3 | |
runs-on: ubuntu-latest | |
env: | |
CLOUDFLARE_ZONE: ${{ secrets.CLOUDFLARE_ZONE }} | |
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
cache: npm | |
- name: Purge cache of Cloudflare CDN | |
run: | | |
npm install esno undici | |
npm run purge-cache |