-
Notifications
You must be signed in to change notification settings - Fork 3
61 lines (50 loc) · 1.51 KB
/
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
---
name: Build artifacts
on:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Create configuration files
run: |
echo $NPMRC > .npmrc
echo $ENV_LOCAL > packages/viewer/.env.local
env:
NPMRC: |
node-linker=hoisted
ENV_LOCAL: ${{ vars.ENV_LOCAL }}
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Use Node.js LTS
uses: actions/setup-node@v3
with:
node-version: lts/*
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Next.js build cache
uses: actions/cache@v3
with:
path: packages/viewer/.next/cache/
key: ${{ runner.os }}-nextjs-${{ hashFiles('pnpm-lock.yaml') }}-${{ hashFiles('packages/viewer/**/*.[jt]s', 'packages/viewer/**/*.[jt]sx') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('pnpm-lock.yaml') }}-
${{ runner.os }}-nextjs-
- name: Build
run: pnpm -r run build
- name: Upload luogu-discussion-archive
uses: actions/upload-artifact@v3
with:
name: luogu-discussion-archive
path: packages/archive/dist/
- name: Upload luogu-discussion-viewer
uses: actions/upload-artifact@v3
with:
name: luogu-discussion-viewer
path: |
packages/viewer/.next/
!packages/viewer/.next/cache/