-
Notifications
You must be signed in to change notification settings - Fork 1
141 lines (113 loc) · 3.09 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: continuous-integration
on:
push:
branches: [master]
pull_request:
branches: [master]
schedule:
- cron: '0 8 * * 2'
jobs:
codeql-analyze:
name: CodeQL analysis
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
language: ['javascript']
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
anchore-scan-backend:
name: Anchore scan backend image
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build Backend image
uses: docker/build-push-action@v2
with:
context: ./backend
file: ./backend/Dockerfile
tags: hugo19941994/hugofs-backend:latest
push: false
load: true
- name: Scan image
uses: anchore/scan-action@v2
with:
image: hugo19941994/hugofs-backend:latest
acs-report-enable: true
- name: upload Anchore scan SARIF report
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: results.sarif
anchore-scan-frontend:
name: Anchore scan frontend image
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build Frontend image
uses: docker/build-push-action@v2
with:
context: ./frontend
file: ./frontend/Dockerfile
tags: hugo19941994/hugofs-frontend:latest
push: false
load: true
- name: Scan image
uses: anchore/scan-action@v2
with:
image: hugo19941994/hugofs-frontend:latest
acs-report-enable: true
- name: upload Anchore scan SARIF report
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: results.sarif
test-backend:
name: Build and lint backend
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [15.x]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: npm install, build, and test backend
run: |
npm --prefix backend ci
npm --prefix backend run lint
env:
CI: true
test-frontend:
name: Build and lint frontend
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [15.x]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: npm install, build, and test frontend
run: |
npm --prefix frontend ci
npm --prefix frontend run lint
env:
CI: true