-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (54 loc) · 1.42 KB
/
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
name: Build
on:
push:
branches: ['main']
pull_request:
branches: ['main']
permissions:
contents: write
issues: write
pages: write
pull-requests: write
id-token: write
jobs:
build:
name: Build
runs-on: ubuntu-20.04
steps:
- name: Install Node.js
uses: actions/setup-node@v2
with:
node-version: '16'
architecture: x64
- name: Git checkout for source code analysis
uses: actions/checkout@v3
- name: Install Dependencies
run: |
npm ci
- name: Cache Node.js modules
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
- name: Run unit tests
run: |
npm run lint
npm run test:ci
- name: Build
if: github.ref == 'refs/heads/main'
run: |
npm run build
- name: Cache dist folder
uses: actions/cache@v3
with:
path: dist
key: company-id-validation-dist-${{ github.run_id }}
release:
uses: RedFroggy/company-id-validator/.github/workflows/release.yml@main
secrets:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
needs: build
pages:
needs: release
uses: RedFroggy/company-id-validator/.github/workflows/pages.yml@main