From 4383ba916c1f1fc6223898cc965b763798537f1c Mon Sep 17 00:00:00 2001 From: Thomas S Date: Tue, 14 Jan 2025 13:05:45 +0100 Subject: [PATCH] ci: Purge documentation CDN cache after new documentation deployment --- .github/workflows/sphinx.yml | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sphinx.yml b/.github/workflows/sphinx.yml index 52779dc51..d3d7f66c5 100644 --- a/.github/workflows/sphinx.yml +++ b/.github/workflows/sphinx.yml @@ -120,18 +120,36 @@ jobs: runs-on: ubuntu-latest needs: [sphinx-version, sphinx-build] steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@v4 + - name: Checkout code + uses: actions/checkout@v4 + + - name: Download HTML artifacts + uses: actions/download-artifact@v4 with: name: sphinx-html-artifact path: html/ - - uses: ./.github/actions/sphinx/deploy + + - name: Deploy HTML artifacts + uses: ./.github/actions/sphinx/deploy with: CONFIGURATION: ${{ secrets.RCLONE_CONFIG_DOCS }} BUCKET: ${{ vars.DOCUMENTATION_BUCKET }} SOURCE: html/ DESTINATION: ${{ needs.sphinx-version.outputs.SPHINX_VERSION }}/ + - name: Purge CDN cache + shell: bash + run: | + curl --fail-with-body \ + -X POST \ + -H "X-Auth-Token: ${TOKEN}" \ + -H "Content-Type: application/json" \ + -d "{\"pipeline_id\":\"${PIPELINE_ID}\",\"all\":true}" \ + "https://api.scaleway.com/edge-services/v1alpha1/purge-requests" + env: + TOKEN: ${{ secrets.SCW_SECRET_KEY }} + PIPELINE_ID: ${{ vars.DOCUMENTATION_EDGE_SERVICES_PIPELINE_ID }} + sphinx-deploy-root-files: if: ${{ github.event_name == 'release' }} runs-on: ubuntu-latest