Update readme.markdown #135
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 Cloudflare cache | |
on: | |
push: | |
branches: | |
- main | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
purge: | |
name: ♻️ Purge Cloudflare cache | |
runs-on: ubuntu-latest | |
steps: | |
- name: ⬇️ Checkout repo | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
- name: ⎔ Enable corepack | |
run: corepack enable | |
- name: ⎔ Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: "pnpm" | |
- name: 🟧 Install dependencies | |
run: pnpm install --recursive --frozen-lockfile --strict-peer-dependencies | |
- name: 📦 Build | |
run: pnpm run build | |
- name: ♻️ Get URLs to Purge | |
id: urls | |
run: | | |
URLS=$(node ./scripts/get-urls-to-purge.js | grep "URLS TO PURGE") | |
echo "urls=$URLS" >> $GITHUB_ENV | |
- name: ♻️ Purge Cloudflare cache | |
uses: jakejarvis/cloudflare-purge-action@v0.3.0 | |
if: steps.urls.outputs.urls != '' | |
env: | |
CLOUDFLARE_ZONE: ${{ secrets.CLOUDFLARE_ZONE }} | |
CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }} | |
PURGE_URLS: ${{ steps.urls.outputs.urls }} |