-
Notifications
You must be signed in to change notification settings - Fork 14
58 lines (47 loc) · 1.11 KB
/
main.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
name: Ubuntu CI/CD
# triggers
on:
push:
pull_request:
workflow_dispatch:
# define job name and sequence
jobs:
build:
name: Build, Test, and Lint
# runner os
runs-on: ubuntu-latest
# cache build deps
steps:
- name: Cache
uses: actions/[email protected]
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
# setup nodejs
- name: Use Node.js 14 LTS
uses: actions/setup-node@v2
with:
node-version: 14 # latest LTS version
# check out repo
- name: Checkout
uses: actions/checkout@v2
# install node_modules
- name: Install
run: npm i
# build package
- name: Build
run: npm run build
env:
NODE_ENV: production
# test package
- name: Test
run: npm test
# lint package
- name: Lint
run: npm run lint
# archive production artifact
- name: Archive
uses: actions/upload-artifact@v2
with:
name: build-artifact
path: dist