Workflow: purge CDN after a new release

This commit is contained in:
loyalsoldier 2021-08-28 19:56:27 +08:00
parent 11a9629129
commit 2884e764f0
No known key found for this signature in database
GPG Key ID: 23829BBC1ACF2C90

View File

@ -127,7 +127,7 @@ jobs:
- name: Git push assets to "release" branch
run: |
cd publish
cd publish || exit 1
git init
git config --local user.name "github-actions[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
@ -136,3 +136,13 @@ jobs:
git commit -m "${{ env.RELEASE_NAME }}"
git remote add origin "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}"
git push -f -u origin release
- name: Purge jsdelivr CDN
run: |
cd publish || exit 1
for file in $(ls); do
curl -i "https://purge.jsdelivr.net/gh/${{ github.repository }}@release/${file}"
done
for file in $(ls ruleset); do
curl -i "https://purge.jsdelivr.net/gh/${{ github.repository }}@release/ruleset/${file}"
done