Skip to content

Commit

Permalink
docs(deployment): Migrate to Bunny CDN (#1244)
Browse files Browse the repository at this point in the history
Co-authored-by: Thomas S. <[email protected]>
  • Loading branch information
jerome-probabl and thomass-dev authored Jan 28, 2025
1 parent 658196e commit 1a0f787
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions .github/workflows/sphinx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,12 @@ jobs:
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"
--url "https://api.bunny.net/purge?url=https%3A%2F%2F${DOMAIN}%2F${VERSION}%2F%2A&async=false" \
--header "AccessKey: ${ACCESS_KEY}"
env:
TOKEN: ${{ secrets.SCW_SECRET_KEY }}
PIPELINE_ID: ${{ vars.DOCUMENTATION_EDGE_SERVICES_PIPELINE_ID }}
ACCESS_KEY: ${{ secrets.BUNNY_API_KEY }}
DOMAIN: ${{ vars.DOCUMENTATION_DOMAIN }}
VERSION: ${{ needs.sphinx-version.outputs.SPHINX_VERSION }}

sphinx-deploy-root-files:
if: ${{ github.event_name == 'release' }}
Expand Down Expand Up @@ -227,6 +226,16 @@ jobs:
ACTION: copy
SOURCE: artifacts/
DESTINATION:
- name: Purge CDN cache
shell: bash
run: |
curl --fail-with-body \
-X POST \
--url "https://api.bunny.net/purge?url=https%3A%2F%2F${DOMAIN}%2F%2A.%2A&async=false" \
--header "AccessKey: ${ACCESS_KEY}"
env:
ACCESS_KEY: ${{ secrets.BUNNY_API_KEY }}
DOMAIN: ${{ vars.DOCUMENTATION_DOMAIN }}

sphinx-clean-artifacts:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 1a0f787

Please sign in to comment.