feat: ✨ 添加异步测试 #41
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
# 1. 为工作流定义名字 | |
name: 「GitHub Pages」Build & Deploy | |
# 2. 触发条件修改为: 当 main 或 master 分支, 有 push 的时候, 执行任务 | |
on: | |
push: | |
branches: | |
- master | |
- admin | |
# 3. 创建工作流 | |
jobs: | |
build: # 工作流名称 | |
runs-on: ubuntu-latest # 依赖环境 | |
steps: # 工作流步骤 | |
# step 1. 获取源码, 拉取仓库代码 | |
- name: Chekcout 🛎️ # 步骤名 | |
uses: actions/checkout@master # 使用插件 => https://github.com/actions/checkout | |
- name: Install pnpm | |
uses: pnpm/[email protected] | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
cache: "pnpm" | |
- name: Install dependencies | |
shell: bash | |
run: pnpm install | |
# step 3. 安装依赖并打包 | |
- name: Install and Build 🔧 | |
run: | | |
pnpm config set registry https://registry.npmmirror.com | |
pnpm build:admin | |
# step 4. 项目部署, 将打包后的产物合并到指定的分支上 | |
- name: Deploy 🚀 # 步骤名 | |
uses: JamesIves/[email protected] # 使用插件 => https://github.com/JamesIves/github-pages-deploy-action | |
with: | |
BRANCH: gh-pages # 部署分支 | |
FOLDER: gbeata-dist # 打包, 静态资源输出的目录 |