-
Notifications
You must be signed in to change notification settings - Fork 23
53 lines (44 loc) · 1.54 KB
/
gh-page.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# 1. 为工作流定义名字
name: 「GitHub Pages」Build & Deploy
# 2. 触发条件修改为: 当 main 或 master 分支, 有 push 的时候, 执行任务
on:
push:
branches:
# - master
- release-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: 18
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-admin # 打包, 静态资源输出的目录
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_PACKAGE }}
run: |
cd ./apps/admin
npx semantic-release