-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (49 loc) · 1.46 KB
/
fe-build.yml
File metadata and controls
53 lines (49 loc) · 1.46 KB
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
name: Frontend Build Workflow
on:
workflow_call:
inputs:
GHA_REF:
type: string
required: true
GHA_BASE:
type: string
required: true
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
target: ['build-storybook', 'build']
jobIndex: [1, 2]
env:
jobCount: 2
NODE_OPTIONS: --max-old-space-size=4096
steps:
- name: Check RAM size
run: |
ram_size_kb=$(grep MemTotal /proc/meminfo | awk '{print $2}')
ram_size_gb=$(echo "scale=2; $ram_size_kb/1024/1024" | bc)
echo "Total RAM size: $ram_size_gb GB"
- uses: actions/checkout@v4
with:
ref: ${{ inputs.GHA_REF }}
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 22.15.0
- name: Cache Node Modules
id: npm-cache
uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
- name: Fetch base branch
run: git fetch origin ${{ inputs.GHA_BASE }}:${{ inputs.GHA_BASE }} || true
- name: Build and Storybook
uses: collaborationFactory/github-actions/.github/actions/run-many@master
with:
target: ${{ matrix.target }}
jobIndex: ${{ matrix.jobIndex }}
jobCount: ${{ env.jobCount }}
base: ${{ inputs.GHA_BASE }}
ref: ${{ inputs.GHA_REF }}