@@ -36,7 +36,7 @@ jobs: # 工作任务
3636 - name : Setup Ruby
3737 uses : ruby/setup-ruby@8575951200e472d5f2d95c625da0c7bec8217c42 # v1.161.0
3838 with :
39- ruby-version : ' 3.1' # Not needed with a .ruby-version file
39+ ruby-version : " 3.1" # Not needed with a .ruby-version file
4040 bundler-cache : true # runs 'bundle install' and caches installed gems automatically
4141 cache-version : 0 # Increment this number if you need to re-download cached gems
4242 - name : Setup Pages
@@ -50,32 +50,34 @@ jobs: # 工作任务
5050 - name : Upload artifact
5151 # Automatically uploads an artifact from the './_site' directory by default
5252 uses : actions/upload-pages-artifact@v3
53-
54- # Deployment job
55- deploy :
56- environment :
57- name : github-pages
58- url : ${{ steps.deployment.outputs.page_url }}
59- runs-on : ubuntu-latest
60- needs : build
61- steps :
62- - name : Deploy to GitHub Pages
63- id : deployment
64- uses : actions/deploy-pages@v4
6553 - name : 部署到阿里云服务器
6654 uses : easingthemes/ssh-deploy@main
6755 env :
6856 # SSH私钥
6957 SSH_PRIVATE_KEY : ${{ secrets.ALIYUN_SSH_KEY }}
7058 # SCP参数
71- ARGS : ' -avzr --delete'
59+ ARGS : " -avzr --delete"
7260 # 源目录(Jekyll构建后的_site目录)
73- SOURCE : ' _site/'
61+ SOURCE : " _site/"
7462 # 服务器IP
7563 REMOTE_HOST : ${{ secrets.ALIYUN_HOST }}
7664 # 服务器用户名
7765 REMOTE_USER : ${{ secrets.ALIYUN_USER }}
7866 # 目标目录
79- TARGET : ' ${{ secrets.REMOTE_TARGET }}'
80- - name : 部署完成
81- run : echo "Jekyll博客部署完成!"
67+ TARGET : " ${{ secrets.REMOTE_TARGET }}"
68+ - name : 阿里云部署完成
69+ run : echo "阿里云服务器部署完成!"
70+
71+ # Deployment job
72+ deploy :
73+ environment :
74+ name : github-pages
75+ url : ${{ steps.deployment.outputs.page_url }}
76+ runs-on : ubuntu-latest
77+ needs : build
78+ steps :
79+ - name : Deploy to GitHub Pages
80+ id : deployment
81+ uses : actions/deploy-pages@v4
82+ - name : GitHub Pages部署完成
83+ run : echo "GitHub Pages部署完成!"
0 commit comments