-
Notifications
You must be signed in to change notification settings - Fork 379
76 lines (63 loc) · 1.91 KB
/
frontend-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
name: Frontend Build
on:
# Allows you to reuse workflows by referencing their YAML files
workflow_call:
outputs:
build-status:
description: "Build status"
value: ${{ jobs.frontend-build.outputs.build-status }}
test-status:
description: "Test status"
value: ${{ jobs.frontend-build.outputs.test-status }}
inputs:
skip_cache:
required: false
type: string
jobs:
frontend-build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
outputs:
build-status: ${{ steps.build.outcome }}
test-status: ${{ steps.test.outcome }}
defaults:
run:
working-directory: ./webapp
steps:
- uses: actions/checkout@v4
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: yarn
cache-dependency-path: webapp/yarn.lock
- name: restore node_modules
uses: actions/cache@v4
with:
path: "**/node_modules"
key: ${{ runner.os }}-node_modules-${{ hashFiles('webapp/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node_modules-
- name: restore typescript cache
uses: actions/cache@v4
with:
path: "**/packages/*/dist"
key: ${{ runner.os }}-dist-${{ hashFiles('webapp/yarn.lock') }}
restore-keys: |
${{ runner.os }}-dist-
- name: yarn clean
if: env.skip_cache == 'true'
run: yarn clear
- run: yarn install --immutable
- run: yarn bundle
working-directory: ./webapp/packages/product-default
- run: yarn test
# - name: Archive build artifacts
# uses: actions/upload-artifact@v4
# with:
# name: frontend-build-artifacts
# path: webapp/packages/product-default/lib
# if-no-files-found: error