-
Notifications
You must be signed in to change notification settings - Fork 37
85 lines (67 loc) · 1.97 KB
/
.reusable_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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# This is a reusable workflow
name: Install Dependencies, Run Lint & Build
on:
workflow_call:
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN_PRIVATE_READ }}
jobs:
lint:
name: Run lint
runs-on: ${{ vars.RUNS_ON }}
steps:
- name: Checkout source code
uses: actions/checkout@v3
- uses: pnpm/action-setup@v2 # version is determined from the packageManager field in package.json by default.
- id: setup-node
name: Setup Node
timeout-minutes: 5
continue-on-error: true
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: pnpm
- name: Install dependency
timeout-minutes: 5
run: pnpm install
- name: Run lint
timeout-minutes: 10
run: pnpm lint
build-assets:
name: Build assets
runs-on: ${{ vars.RUNS_ON }}
steps:
- name: Checkout source code
uses: actions/checkout@v3
- uses: pnpm/action-setup@v2 # version is determined from the packageManager field in package.json by default.
- id: setup-node
name: Setup Node
timeout-minutes: 5
continue-on-error: true
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: pnpm
- name: Install dependencies
timeout-minutes: 5
run: pnpm install
- name: Build assets
timeout-minutes: 10
env:
NODE_OPTIONS: "--max-old-space-size=8192"
run: |
pnpm build
echo "${{ github.sha }}" > dist/build.sha1
- name: Pack assets
run: tar -cvzf ./assets.tar.gz dist/*
- name: Upload assets
timeout-minutes: 5
uses: actions/upload-artifact@v4
with:
name: assets
path: ./assets.tar.gz
- name: Upload bundle-analyzer
timeout-minutes: 5
uses: actions/upload-artifact@v4
with:
name: bundle-analyzer
path: bundle-analyzer/