-
Notifications
You must be signed in to change notification settings - Fork 14
61 lines (50 loc) · 1.51 KB
/
ci.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: Lint and Build
on:
# Run on PR for CI purposes
pull_request:
# Run on push to our deployed branches for CD purposes
push:
branches:
- develop
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache npm files
uses: actions/cache@v3
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install Dependencies
run: npm install
- name: Lint Files
run: npm run lint
- name: Build
run: npm run build
# Uncomment when ready to run tests
# - name: Test
# run: npm test
# Used to test deployment integration
# - name: Upload Build artifacts for testing
# if: ${{ github.ref == 'refs/heads/test-github-actions' }}
# uses: actions/upload-artifact@v2
# with:
# name: build-test
# path: build
- name: Upload develop build artifacts for deployment
if: ${{ github.ref == 'refs/heads/develop' }}
uses: actions/upload-artifact@v3
with:
name: build-train
path: dist
- name: Upload master build artifacts for deployment
if: ${{ github.ref == 'refs/heads/master' }}
uses: actions/upload-artifact@v3
with:
name: build-prod
path: dist