Merge pull request #340 from pysio2007/deepsource-autofix-ea9fa82e #221
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
name: note build | |
# 触发workflow的条件 | |
on: | |
push: | |
# 只有main分支发生push事件时,才会触发workflow | |
branches: [main] | |
env: | |
SERVER_PRIVATE_KEY: ${{ secrets.SERVER_PRIVATE_KEY }} # 服务器私钥 | |
SERVER_HOST: ${{ secrets.SERVER_HOST }} # 服务器IP地址 | |
USER_NAME: ${{ secrets.USER_NAME }} # 服务器用户名 | |
# jobs表示执行的一项或多项任务 | |
jobs: | |
build: # 任务的job_id,具体名称自定义,这里build代表打包 | |
runs-on: ubuntu-latest # runs-on字段指定运行所需要的虚拟机环境。注意:这个是必填字段 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- name: 设置 Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: 安装依赖 | |
run: | | |
corepack enable | |
npm ci | |
- name: 构建文档 | |
env: | |
NODE_OPTIONS: --max_old_space_size=8192 | |
run: |- | |
npm run docs:build | |
# 上传打包资源 | |
- name: Deploy | |
uses: easingthemes/ssh-deploy@v5.1.1 | |
env: | |
SSH_PRIVATE_KEY: ${{ env.SERVER_PRIVATE_KEY }} | |
ARGS: '-avz --delete' | |
SOURCE: 'src/.vuepress/dist/' | |
REMOTE_HOST: ${{ env.SERVER_HOST }} | |
REMOTE_USER: ${{ env.USER_NAME }} | |
TARGET: /www/wwwroot/pysio.online # 服务器目标路径 |