-
Notifications
You must be signed in to change notification settings - Fork 0
/
ci.yml
40 lines (37 loc) · 1.02 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
name: devops
on:
push:
branches:
- main
jobs:
devops:
name: devops
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup java 11
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '11'
cache: 'maven'
- name: Run unit tests
run: mvn test -f devops/pom.xml
- name: Build and push Docker image
uses: elgohr/[email protected]
with:
name: chillaso/devops
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Vulnerability scan
uses: aquasecurity/trivy-action@master
with:
image-ref: 'docker.io/chillaso/devops:latest'
format: 'template'
template: '@/contrib/sarif.tpl'
output: 'trivy-results.sarif'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: 'trivy-results.sarif'