-
Notifications
You must be signed in to change notification settings - Fork 10
45 lines (39 loc) · 1.02 KB
/
build-web.yaml
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
name: 构建网页版本并部署到 Github Pages
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
build-web:
name: 构建网页版本并部署到 Github Pages
runs-on: ubuntu-latest
steps:
- name: 克隆仓库源代码
uses: actions/[email protected]
with:
submodules: recursive
fetch-depth: 0
- name: 安装 PNPM
uses: pnpm/[email protected]
with:
version: latest
- name: 安装 Node.js
uses: actions/[email protected]
with:
node-version: lts/*
cache: pnpm
- name: 安装前端依赖
run: pnpm i
- name: 构建网页版本
run: pnpm build
- name: 部署到 Github Pages
uses: crazy-max/[email protected]
with:
target_branch: gh-pages
build_dir: dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}