Skip to content

Commit fcba013

Browse files
committed
ci: Purge documentation CDN cache after new documentation deployment
1 parent 4d28474 commit fcba013

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

.github/workflows/sphinx.yml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,18 +120,37 @@ jobs:
120120
runs-on: ubuntu-latest
121121
needs: [sphinx-version, sphinx-build]
122122
steps:
123-
- uses: actions/checkout@v4
124-
- uses: actions/download-artifact@v4
123+
- name: Checkout code
124+
uses: actions/checkout@v4
125+
126+
- name: Download HTML artifacts
127+
uses: actions/download-artifact@v4
125128
with:
126129
name: sphinx-html-artifact
127130
path: html/
128-
- uses: ./.github/actions/sphinx/deploy
131+
132+
- name: Deploy HTML artifacts
133+
uses: ./.github/actions/sphinx/deploy
129134
with:
130135
CONFIGURATION: ${{ secrets.RCLONE_CONFIG_DOCS }}
131136
BUCKET: ${{ vars.DOCUMENTATION_BUCKET }}
132137
SOURCE: html/
133138
DESTINATION: ${{ needs.sphinx-version.outputs.SPHINX_VERSION }}/
134139

140+
- name: Purge CDN cache
141+
shell: bash
142+
run: |
143+
curl --fail-with-body \
144+
-X POST \
145+
-H "X-Auth-Token: ${TOKEN}" \
146+
-H "Content-Type: application/json" \
147+
-d "{\"pipeline_id\":\"${PIPELINE_ID}\",\"assets\":[\"${ASSET}\"]}" \
148+
"https://api.scaleway.com/edge-services/v1alpha1/purge-requests"
149+
env:
150+
TOKEN: ${{ secrets.SCW_SECRET_KEY }}
151+
PIPELINE_ID: ${{ vars.DOCUMENTATION_EDGE_SERVICES_PIPELINE_ID }}
152+
ASSET: ${{ needs.sphinx-version.outputs.SPHINX_VERSION }}/
153+
135154
sphinx-deploy-root-files:
136155
if: ${{ github.event_name == 'release' }}
137156
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)