forked from jvvillanueva9104/CI-CD-Backend-Project
-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (58 loc) · 1.7 KB
/
m3pipeline.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
68
69
70
71
72
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code, run tests, and deploy to Azure Web Apps
# For more information, see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
name: Node.js CI and Deployment
on:
push:
branches:
- "feature/*"
pull_request:
branches:
- "develop"
- "main"
jobs:
build_and_test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
registry-url: "https://registry.npmjs.org"
- name: Install NPM
run: npm install
- name: Install Dependencies
run: npm ci
- name: Build
run: npm run build
- name: Run Tests
run: npm test
- name: Upload artifact for deployment job
uses: actions/upload-artifact@v2
with:
name: node-app
path: |
dist/
src/
test/
mocharc.json
package-lock.json
package.json
tsconfig.json
.gitignore
static_code_analysis:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Snyk CLI
run: npm install -g snyk
- name: Authenticate with Snyk
run: snyk auth ${{ secrets.SNYK_TOKEN }}
- name: Run Snyk Scan
run: snyk test --all-projects --severity-threshold=high
#comment 12