Skip to content

chore: use env variable #126

chore: use env variable

chore: use env variable #126

Workflow file for this run

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 }}