Update vscode.md #14
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: Build app and deploy to aliyun | |
on: | |
#监听push操作 | |
push: | |
branches: | |
# main分支,你也可以改成其他分支 | |
- main | |
jobs: | |
build: | |
# runs-on 指定job任务运行所需要的虚拟机环境(必填字段) | |
runs-on: ubuntu-latest | |
steps: | |
# 获取源码 | |
- name: Checkout | |
# 使用action库 actions/checkout获取源码 | |
uses: actions/checkout@master | |
# 安装Node13 | |
- name: use Node.js 14.19.3 | |
# 使用action库 actions/setup-node安装node | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 14.19.3 | |
# 安装yarn | |
- name: npm install yarn -g | |
run: npm install yarn -g | |
# 安装依赖 | |
- name: install & build | |
run: yarn && yarn build | |
- name: Deploy to Server # | |
uses: AEnterprise/rsync-deploy@v1.0.2 # 使用别人包装好的步骤镜像 | |
env: | |
DEPLOY_KEY: ${{ secrets.SSH_PRIVATE_KEY }} # 引用配置,SSH私钥 | |
ARGS: "-e -c -r --delete" | |
SERVER_PORT: ${{ secrets.SERVER_PORT }} # SSH端口 | |
FOLDER: ".vuepress/dist/" # 要推送的文件夹,路径相对于代码仓库的根目录,视情况替换为自己的文件夹路径 | |
SERVER_IP: ${{ secrets.SERVER_IP }} # 引用配置,服务器的host名(IP或者域名domain.com) | |
USERNAME: ${{ secrets.USERNAME }} # 引用配置,服务器登录名 | |
SERVER_DESTINATION: ${{ secrets.SERVER_DESTINATION }} # 部署到目标文件夹 |