Skip to content

Commit 729e429

Browse files
📝 更新GitHub工作流,优化SSH设置和文件部署步骤
- 将SSH代理的版本更新至v0.9.0,确保使用最新的功能和安全性。 - 合并SSH主机密钥添加与rsync文件同步步骤,简化部署流程,提升效率。 - 更新rsync命令,确保文件正确同步到指定服务器路径,增强部署的可靠性。
1 parent 602fd71 commit 729e429

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

.github/workflows/updata.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,16 @@ jobs:
1818
with:
1919
github_token: ${{ secrets.GITHUB_TOKEN }}
2020
publish_dir: ./build
21-
- name: Deploy to mainland server
22-
uses: webfactory/ssh-agent@v0.8.0
21+
- name: Setup SSH
22+
uses: webfactory/ssh-agent@v0.9.0
2323
with:
2424
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
2525

26-
- name: Add SSH host key and deploy
26+
- name: Deploy to server
2727
run: |
2828
mkdir -p ~/.ssh
29-
ssh-keyscan -H ${{ secrets.IPv4 }} >> ~/.ssh/known_hosts
30-
rsync -avz --exclude='.user.ini' ./build/ ${{ secrets.IP }}
31-
continue-on-error: true
29+
ssh-keyscan -H ${{ secrets.IP }} >> ~/.ssh/known_hosts
30+
rsync -avz --exclude='.user.ini' ./build/ root@${{ secrets.IP }}:/www/wwwroot/jiangmiemie.com
31+
env:
32+
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
33+
SERVER_IP: ${{ secrets.IP }}

0 commit comments

Comments
 (0)