Skip to content

Commit

Permalink
ci: Purge documentation CDN cache after new documentation deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
thomass-dev committed Jan 14, 2025
1 parent 4d28474 commit 4383ba9
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions .github/workflows/sphinx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4383ba9

Please sign in to comment.