Skip to content

chore: actions deploy #8

chore: actions deploy

chore: actions deploy #8

Workflow file for this run

name: Deploy My Server
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest # 使用ubuntu系统镜像运行自动化脚本
steps: # 自动化步骤
#下载代码仓库
- uses: actions/checkout@v1
# 使用action库,安装node
- name: use Node.js # 使用action库 actions/setup-node安装node
uses: actions/setup-node@v1
with:
node-version: 18.17.0 # 指定node版本
# 安装依赖
- name: npm install
run: npm install
#打包项目
- name: Build
run: npm run build
#部署到服务器
- name: Deploy to Staging My server
uses: easingthemes/[email protected]
env:
#私钥
SSH_PRIVATE_KEY: ${{ secrets.MY_SERVER_PRIVATE_KEY }}
ARGS: "-rltgoDzvO"
SOURCE: "docs/.vuepress/dist"
REMOTE_HOST: ${{ secrets.IP }} #服务器ip
REMOTE_USER: "root"
TARGET: "/root/app/"
EXCLUDE: "/dist/, /node_modules/"