Skip to content

Commit 04941af

Browse files
committed
feat: refresh cdn after deploying to oss
1 parent d5c2256 commit 04941af

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

.github/workflows/deploy_to_oss.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,15 @@ jobs:
3838
--access-key-id ${{ secrets.ALIYUN_ACCESS_KEY_ID }} \
3939
--access-key-secret ${{ secrets.ALIYUN_ACCESS_KEY_SECRET }}
4040
41-
- name: Operate Aliyun OSS
41+
- name: Deploy to Aliyun OSS
4242
run: |
43-
aliyun ossutil rm -r oss://blog-web-shanghai/ -f
44-
aliyun ossutil cp -r ./public/ oss://blog-web-shanghai/
43+
aliyun ossutil rm -r ${{ vars.WEB_OSS_PATH }} -f
44+
aliyun ossutil cp -r ./public/ ${{ vars.WEB_OSS_PATH }}
45+
46+
- name: Refresh Aliyun CDN
47+
run: |
48+
aliyun cdn RefreshObjectCaches \
49+
--region ${{ vars.REGION }} \
50+
--ObjectPath ${{ vars.WEB_DIRECTORY }} \
51+
--ObjectType Directory \
52+
--Force false

0 commit comments

Comments
 (0)