-
Notifications
You must be signed in to change notification settings - Fork 36
58 lines (56 loc) · 1.66 KB
/
build-image.yaml
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
name: Build Image
on:
pull_request:
jobs:
build-image:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4
with:
submodules: recursive
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to Quay.io Container Registry
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAYIO_USERNAME }}
password: ${{ secrets.QUAYIO_TOKEN }}
-
name: Build Latest Version
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: |
quay.io/appuio/example-spring-boot:pr-${{ github.event.pull_request.number }}
-
name: Run vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: 'quay.io/appuio/example-spring-boot:pr-${{ github.event.pull_request.number }}'
format: 'table'
output: 'trivy-results.txt'
exit-code: '0'
ignore-unfixed: true
vuln-type: 'os'
severity: 'CRITICAL,HIGH'
-
name: Archive vulnerability scan results
uses: actions/upload-artifact@v4
with:
name: trivy-results-build
path: trivy-results.txt
-
uses: addnab/docker-run-action@v3
with:
image: 'quay.io/appuio/example-spring-boot:pr-${{ github.event.pull_request.number }}'
run: echo "hello world"