Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 7206cf0

Browse files
committedApr 20, 2024
更换deloy
1 parent 4decab7 commit 7206cf0

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed
 

‎.github/workflows/jekyll-build-deploy.yml

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,27 @@ jobs:
2424
- name: Build Jekyll
2525
run: bundle exec jekyll build
2626

27-
- name: Upload to server
28-
uses: appleboy/ssh-action@master
27+
# - name: Upload to server
28+
# uses: appleboy/ssh-action@master
29+
# with:
30+
# host: ${{ secrets.SERVER_HOST }}
31+
# username: ${{ secrets.SERVER_USERNAME }}
32+
# #这里的private key 是本地生成的,然后自己本地服务ssh,成功之后,进行远程服务登录,然后将本地的privatekey保存到github变量中
33+
# key: ${{ secrets.SSH_PRIVATE_KEY }}
34+
# script: |
35+
# rsync -azv --delete comsince.github.io/_site/ /data/boot/comsince.cn
36+
37+
38+
- name: Deploy to Server # 第二步,rsync推文件
39+
uses: AEnterprise/rsync-deploy@v1.0 # 使用别人包装好的步骤镜像
2940
with:
30-
host: ${{ secrets.SERVER_HOST }}
31-
username: ${{ secrets.SERVER_USERNAME }}
32-
#这里的private key 是本地生成的,然后自己本地服务ssh,成功之后,进行远程服务登录,然后将本地的privatekey保存到github变量中
33-
key: ${{ secrets.SSH_PRIVATE_KEY }}
34-
script: |
35-
rsync -azv --delete comsince.github.io/_site/ /data/boot/comsince.cn
41+
DEPLOY_KEY: ${{ secrets.SSH_PRIVATE_KEY }} # 引用配置,SSH私钥
42+
ARGS: -avz --delete # rsync参数,排除.pyc文件
43+
SERVER_PORT: '22' # SSH端口
44+
FOLDER: _site/ # 要推送的文件夹,路径相对于代码仓库的根目录
45+
SERVER_IP: ${{ secrets.SERVER_HOST }} # 引用配置,服务器的host名(IP或者域名domain.com)
46+
USERNAME: ${{ secrets.SERVER_USERNAME }} # 引用配置,服务器登录名
47+
SERVER_DESTINATION: /data/boot/comsince.cn # 部署到目标文件夹
3648

3749
- name: SSH into server
3850
uses: appleboy/ssh-action@master

0 commit comments

Comments
 (0)
Please sign in to comment.