Skip to content

CI: Add step to purge Cloudflare cache #46

CI: Add step to purge Cloudflare cache

CI: Add step to purge Cloudflare cache #46

Workflow file for this run

name: CI
on: [push, pull_request]
jobs:
Build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
bundler-cache: true
- name: Install i18n dependencies
run: |
sudo apt-get update
sudo apt-get install translate-toolkit
- name: Build website
run: |
scripts/build.sh
- name: Publish to Cloudflare Pages
if: ${{ github.event_name == 'push' && github.repository == 'ubuntu-mate/start.ubuntu-mate.org' && github.ref == 'refs/heads/master' }}
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: e6fe5e31e8183c8192347f15af553766
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 -F -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 '{"purge_everything":true}'