Create main.yml #1
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 and Deploy | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest # 构建环境使用 ubuntu | |
steps: | |
- name: Checkout # 将代码拉到虚拟机 | |
uses: actions/[email protected] | |
with: | |
persist-credentials: false | |
- name: Install and Build # 下载依赖 打包项目 | |
run: | |
pnpm install | |
pnpm build | |
- name: Deploy # 部署 | |
run: pnpm start:prod & |