Skip to content

Commit

Permalink
ci: purge cloudflare cache when changes to app dir
Browse files Browse the repository at this point in the history
Signed-off-by: Logan McAnsh <logan@mcan.sh>
  • Loading branch information
mcansh committed Dec 6, 2023
1 parent 1949cf8 commit 2b79a76
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/purge-cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: ♻️ Purge Cloudflare cache

on:
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
deploy:
name: ♻️ Purge Cloudflare cache
runs-on: ubuntu-latest

steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4

- name: 📝 Get changed files
id: changed-files
uses: tj-actions/changed-files@v40.2.1
with:
path: "./app"

- name: ♻️ Purge Cloudflare cache
if: ${{ github.ref == 'refs/heads/main' }} && steps.changed-files.outputs.any_changed == 'true'
uses: jakejarvis/cloudflare-purge-action@v0.3.0
env:
CLOUDFLARE_ZONE: ${{ secrets.CLOUDFLARE_ZONE }}
CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }}
PURGE_URLS: '["https://www.mcan.sh", "https://www.mcan.sh/resume", "https://www.mcan.sh/resume.pdf"]'

0 comments on commit 2b79a76

Please sign in to comment.