-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (50 loc) · 1.32 KB
/
build-ui.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 UI
on:
workflow_call:
inputs:
upload_artifact:
description: "Upload the build artifact"
required: false
default: false
type: boolean
version:
description: "Version"
required: false
default: "local"
type: string
env:
NODE_VERSION: 20.12.2
jobs:
build-ui:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./ui
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Prepare
id: prep
run: |
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Lint ui
run: yarn lint
- name: Test ui
run: yarn test
- name: Build ui
env:
VERSION: ${{ inputs.version }}
GIT_COMMIT: ${{ steps.prep.outputs.sha_short }}
run: yarn build
- name: Upload build artifact
if: ${{ inputs.upload_artifact }}
uses: actions/upload-artifact@v4
with:
name: tvhgo-ui-${{ github.sha }}
path: ./ui/dist