-
Notifications
You must be signed in to change notification settings - Fork 4
/
codefresh.yml
55 lines (49 loc) · 1.22 KB
/
codefresh.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
version: '1.0'
steps:
main_clone:
title: Cloning main repository...
type: git-clone
repo: '${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}'
revision: '${{CF_REVISION}}'
install_dependencies:
title: 'Installing testing dependencies'
image: node:${{NODE_VERSION}}
commands:
- yarn install --frozen-lockfile
security_scan:
image: aquasec/trivy:latest
title: "Scanning lockfile for security vulnerablities"
fail_fast: false
commands:
- '! rm ${{SEC_SCAN_REPORT_FILE}} 2>/dev/null'
- |-
set -eo pipefail; \
trivy \
fs \
--quiet \
--ignorefile /tmp/.trivy/trivyignore \
--ignore-unfixed \
--exit-code 1 \
. \
| tee ${{SEC_SCAN_REPORT_FILE}}
test:
type: parallel
steps:
eslint:
title: 'Running linting logic'
image: node:${{NODE_VERSION}}
commands:
- yarn eslint
unit_tests:
title: 'Running unit-tests'
image: node:${{NODE_VERSION}}
commands:
- yarn test
deploy_to_npm:
type: npm-publish
arguments:
NPM_TOKEN: '${{NPM_TOKEN}}'
DIR: '${{CF_REPO_NAME}}'
when:
branch:
only: [ master ]