-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (60 loc) · 1.74 KB
/
frontend.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
name: Frontend CI
on:
pull_request:
paths:
- 'react-frontend/**'
jobs:
dependencies:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'
- uses: actions/cache@v3
id: cache-node-modules
with:
path: react-frontend/node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('react-frontend/package-lock.json') }}
- run: npm install
working-directory: react-frontend
lint:
runs-on: ubuntu-latest
needs: dependencies
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'
- uses: actions/cache@v3
with:
path: react-frontend/node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('react-frontend/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node_modules-
- run: npm run lint
working-directory: react-frontend
build:
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'
- uses: actions/cache@v3
with:
path: react-frontend/node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('react-frontend/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node_modules-
- run: npm run build
working-directory: react-frontend
- name: Archive artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: react-frontend/dist