-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
20 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,11 +5,11 @@ on: | |
branches: | ||
- main | ||
|
||
env: # 设置环境变量 | ||
TZ: Asia/Shanghai # 时区(设置时区可使页面中的`最近更新时间`使用时区时间) | ||
env: | ||
TZ: Asia/Shanghai | ||
|
||
jobs: | ||
build: # 自定义名称 | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 🚀 检查代码 | ||
|
@@ -25,14 +25,23 @@ jobs: | |
npm install | ||
npm run docs:build | ||
- name: 🛠️ Add SSH Key to known_hosts | ||
run: | | ||
mkdir -p ~/.ssh | ||
ssh-keyscan -H ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts | ||
- name: 🛠️ Setup SSH | ||
uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
|
||
- name: 🚁 部署到服务器 | ||
uses: wlixcc/[email protected] | ||
with: | ||
username: ${{ secrets.SSH_USERNAME }} #ssh user name | ||
port: '22' # 远程服务器ssh端口,默认22 | ||
server: ${{ secrets.SSH_HOST }} # 远程服务器IP地址 | ||
password: ${{ secrets.SSH_PASSWORD }} # 远程服务器密码 | ||
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} # 认证服务器秘钥对的私钥 | ||
local_path: '.vitepress/dist/*' # 对应我们项目打包后的静态文件路径 | ||
remote_path: ${{ secrets.WEB_PATH }} # 服务器上的路径 | ||
delete_remote_files: true # 是否删除远程服务器上的文件 | ||
username: ${{ secrets.SSH_USERNAME }} | ||
port: '22' | ||
server: ${{ secrets.SSH_HOST }} | ||
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
local_path: '.vitepress/dist/*' | ||
remote_path: ${{ secrets.WEB_PATH }} | ||
delete_remote_files: true |