Skip to content

Commit 0f66df2

Browse files
committed
feat: 新增upload工作流
1 parent 77a94b9 commit 0f66df2

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

.github/workflows/upload.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# .github/workflows/ssh-upload.yml
2+
# 将gh-pages分支的文件上传到服务器
3+
name: upload-to-server
4+
5+
on:
6+
workflow_run:
7+
workflows: ["deploy"]
8+
types:
9+
- completed
10+
11+
jobs:
12+
upload:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout gh-pages
17+
uses: actions/checkout@v3
18+
with:
19+
ref: gh-pages
20+
21+
- name: Deploy to Server via SSH
22+
uses: appleboy/scp-action@v0.1.7
23+
with:
24+
host: ${{ secrets.SSH_HOST }}
25+
username: ${{ secrets.SSH_USER }}
26+
key: ${{ secrets.SSH_PRIVATE_KEY }}
27+
source: "./"
28+
target: ${{ secrets.SSH_UPLOAD_PATH }} # 修改为你的服务器路径

0 commit comments

Comments
 (0)