Skip to content

Commit

Permalink
CI: Add step to purge Cloudflare cache
Browse files Browse the repository at this point in the history
This was previously run as a 'post-deploy-actions.sh' script on the
server via SSH.
  • Loading branch information
lah7 committed Dec 10, 2024
1 parent 05d346c commit 4844b76
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,8 @@ jobs:
projectName: start-ubuntu-mate-org
directory: _site
gitHubToken: ${{ secrets.GITHUB_TOKEN }}

- name: Purge Cloudflare Cache
if: ${{ github.event_name == 'push' && github.repository == 'ubuntu-mate/start.ubuntu-mate.org' && github.ref == 'refs/heads/master' }}
run: |
curl -X POST --fail-with-body 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 '{"purge_everything":true}'

0 comments on commit 4844b76

Please sign in to comment.