Create aliyun-backup.yml
This commit is contained in:
1 parent
c427ba2c3f
commit
c06f7a8826
1 file changed
+32
@@ -0,0 +1,32 @@
|
|||||||
|
name: 备份博客文件至阿里云oss
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: ["main"]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: "pages"
|
||||||
|
cancel-in-progress: false
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
publish:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: 下载代码
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: 配置阿里云OSS
|
||||||
|
uses: manyuanrong/setup-ossutil@v3.0
|
||||||
|
with:
|
||||||
|
endpoint: ${{ secrets.OSS_ENDPOINT }}
|
||||||
|
access-key-id: ${{ secrets.OSS_ACCESS_KEY_ID }}
|
||||||
|
access-key-secret: ${{ secrets.OSS_ACCESS_KEY_SECRET }}
|
||||||
|
|
||||||
|
- name: 增量上传资源(排除 public 文件夹)
|
||||||
|
run: |
|
||||||
|
# 使用 ossutil sync 进行增量同步,并排除 public 文件夹
|
||||||
|
ossutil sync . oss://${{ secrets.OSS_BUCKET }} --exclude "public/*" --delete
|
||||||
Reference in new issue
Block a user