-
-
Notifications
You must be signed in to change notification settings - Fork 66
67 lines (53 loc) · 1.37 KB
/
test-build.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: TEST_BUILD
on:
workflow_call:
pull_request:
branches: [next, main]
types: [opened, synchronize, reopened]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node_version:
- 20
steps:
- uses: actions/checkout@main
with:
# “最近更新时间” 等 git 日志相关信息,需要拉取全部提交记录
fetch-depth: 0
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: false
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
# 构建
- name: Refresh Blog Data
run: pnpm build-blog
- name: Build
run: pnpm site:preview
- name: Build lunaria
run: pnpm lunaria:build
- run: |
zip -r _site.zip ./dist
- name: upload _site artifact
uses: actions/upload-artifact@v4
with:
name: _site
path: _site.zip
retention-days: 5
- name: Save PR number
if: ${{ always() }}
run: echo ${{ github.event.number }} > ./pr-id.txt
- name: Upload PR number
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: pr
path: ./pr-id.txt