Skip to content

Instantly share code, notes, and snippets.

@lynshi
Last active February 2, 2021 20:42
Show Gist options
  • Save lynshi/6f4efd7a2ddb39e814cd79d03a26dbbd to your computer and use it in GitHub Desktop.
Save lynshi/6f4efd7a2ddb39e814cd79d03a26dbbd to your computer and use it in GitHub Desktop.
Sample GitHub Action for purging Azure CDN
name: Purge Azure CDN
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Azure service principal login
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
# Do other steps
- name: Purge CDN
run:
az cdn endpoint purge -n ${{ secrets.AZURE_CDN_ENDPOINT }} --profile-name ${{ secrets.AZURE_CDN_PROFILE_NAME }} --content-paths "/*" --resource-group ${{ secrets.AZURE_RESOURCE_GROUP }} --no-wait
- name: Azure service principal logout
run: |
az logout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment