name: me-build-pro
# 触发条件 push 到main分支时
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
# 设置环境变量
env:
NODE_ENV: production
steps:
- name: Checkout ?️
uses: actions/checkout@v2 # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly.
with:
persist-credentials: false
- name: Install and Build ?
# 安装依赖 & 打包
run: |
npm install
npm run build
# 发布 git page
- name: Deploy ?
uses: JamesIves/github-pages-deploy-action@4.1.5
with:
branch: gh-pages # The branch the action should deploy to.
folder: dist # The folder the action should deploy.
暂无评论