Skip to content

Commit d5f547e

Browse files
📝 更新GitHub工作流,增加部署到主服务器的步骤
- 新增了SSH密钥的使用,确保安全连接。 - 添加了使用rsync命令将构建文件同步到服务器的步骤,提升了部署效率。
1 parent ab131f6 commit d5f547e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

.github/workflows/updata.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,10 @@ jobs:
1717
if: github.ref == 'refs/heads/main'
1818
with:
1919
github_token: ${{ secrets.GITHUB_TOKEN }}
20-
publish_dir: ./build
20+
publish_dir: ./build
21+
- name: Deploy to mainland server
22+
uses: webfactory/[email protected]
23+
with:
24+
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
25+
- name: Rsync files to server
26+
run: rsync -avz --delete ./build/ ${{ secrets.IP }}

0 commit comments

Comments
 (0)