Skip to content

Commit

Permalink
Use CURL to purge Cloudflare assets in production, too
Browse files Browse the repository at this point in the history
Follow up to #2077, where I forgot we got _two_ identical actions
  • Loading branch information
Serjlee authored Aug 6, 2024
1 parent efbc5c9 commit c9805c6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/deploy-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ jobs:
- name: Sync PDF
run: aws s3 sync --cache-control "public, max-age=86400, must-revalidate" --include "*.pdf" --exclude="*.js" --exclude="*.gif" --exclude="*.png" --exclude="*.svg" --exclude="*.css" --exclude="*.html" --exclude="*.json" --exclude="sw.json" --delete public/ s3://${{ secrets.PRODUCTION_BUCKET_NAME }}/

- name: Invalidate cloudflare cache
uses: nathanvaughn/actions-cloudflare-purge@master
with:
cf_zone: ${{ secrets.CLOUDFLARE_ZONE }}
cf_auth: ${{ secrets.CLOUDFLARE_PURGE_API_TOKEN }}
prefixes: https://docs.arduino.cc/resources/datasheets/
- name: Purge cache on CloudFlare
run: |
curl -X POST "https://api.cloudflare.com/client/v4/zones/${{ secrets.CLOUDFLARE_ZONE }}/purge_cache" \
-H "Authorization: Bearer ${{ secrets.CLOUDFLARE_PURGE_API_TOKEN }}" \
-H "Content-Type: application/json" \
--data '{"prefixes":["${{ vars.DATASHEETS_BASE_URL }}"]}'

0 comments on commit c9805c6

Please sign in to comment.