Revert "fix sentry svg (#2967)" (#2968) #7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Purge Fastly Cache | |
| on: | |
| push: | |
| branches: [main] | |
| paths: ['static/**', 'templates/**', '**/templates/**'] | |
| workflow_dispatch: | |
| inputs: | |
| target: | |
| description: 'Surrogate key to purge' | |
| required: true | |
| default: 'pydotorg-app' | |
| type: choice | |
| options: [pydotorg-app, downloads, events, sponsors, jobs] | |
| permissions: {} | |
| jobs: | |
| purge: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| if: github.event_name == 'push' | |
| with: | |
| fetch-depth: 0 | |
| - name: Resolve keys | |
| id: keys | |
| run: | | |
| if [ -n "${{ inputs.target }}" ]; then | |
| echo "keys=${{ inputs.target }}" >> "$GITHUB_OUTPUT" | |
| elif git diff --name-only ${{ github.event.before }}..${{ github.sha }} | grep -qE '^(static/|templates/)'; then | |
| echo "keys=pydotorg-app" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "keys=$(git diff --name-only ${{ github.event.before }}..${{ github.sha }} | grep -oP '^apps/\K[^/]+(?=/(templates|static)/)' | sort -u | tr '\n' ' ')" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Purge ${{ steps.keys.outputs.keys || 'pydotorg-app' }} | |
| run: | | |
| for KEY in ${{ steps.keys.outputs.keys || 'pydotorg-app' }}; do | |
| curl -fsS -X POST \ | |
| "https://api.fastly.com/service/${{ secrets.FASTLY_SERVICE_ID }}/purge/$KEY" \ | |
| -H "Fastly-Key: ${{ secrets.FASTLY_API_KEY }}" | |
| done |