Last active
February 2, 2021 20:42
-
-
Save lynshi/6f4efd7a2ddb39e814cd79d03a26dbbd to your computer and use it in GitHub Desktop.
Sample GitHub Action for purging Azure CDN
This file contains 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 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