Skip to content

Clear cache

Clear cache #4

name: Clear cache
on:
workflow_dispatch:
inputs:
custom_path:
description: 'Custom path'
required: true
default: 'mypath/cat.jpg'
jobs:
clear-cache:
runs-on: ubuntu-latest
steps:
- name: Clear cache in cloudflare
run: |
curl -X POST "https://api.cloudflare.com/client/v4/zones/${{secrets.CLOUDFLARE_ZONE_ID}}/purge_cache" \
-H "Authorization: Bearer ${{secrets.CLOUDFLARE_API_TOKEN}}" \
-H "Content-Type: application/json" \
--data '{"files":["https://www.monadical.com/${{github.event.inputs.custom_path}}]"}' || echo "Failed to clear caches"