From 9666b7322241806cff4d63c37bb0d65f57883148 Mon Sep 17 00:00:00 2001 From: pzcn Date: Sat, 28 Aug 2021 19:31:31 +0800 Subject: [PATCH] Purge CDN after a new release (#45) Co-authored-by: Loyalsoldier <10487845+Loyalsoldier@users.noreply.github.com> --- .github/workflows/run.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run.yml b/.github/workflows/run.yml index f05050f..1e9d0dc 100644 --- a/.github/workflows/run.yml +++ b/.github/workflows/run.yml @@ -116,7 +116,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" @@ -125,3 +125,10 @@ jobs: git commit -m "${{ env.RELEASE_NAME }}" git remote add origin "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}" git push -f 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