10
10
jobs :
11
11
# This workflow contains a single job called "build"
12
12
build :
13
+ strategy :
14
+ matrix :
15
+ docker : ['scratch','ubi']
13
16
env :
14
17
VERSION : latest
15
18
EXPORTER_NAME : redis-exporter
16
19
# The type of runner that the job will run on
17
20
runs-on : ubuntu-latest
21
+ name : ${{ matrix.docker }}
18
22
steps :
19
23
- name : Checkout
20
24
uses : actions/checkout@v2
32
36
run : |
33
37
docker pull artifactory.internal.sysdig.com/$EXPORTER_NAME:$VERSION
34
38
export RELEASE=$(docker inspect --format '{{ index .Config.Labels "release" }}' artifactory.internal.sysdig.com/$EXPORTER_NAME:$VERSION)
35
- docker build --label release=$RELEASE -f ./docker/Dockerfile -t $EXPORTER_NAME:$VERSION --target scratch .
36
- docker build --label version=$RELEASE -f ./docker/Dockerfile -t $EXPORTER_NAME:$VERSION-ubi --target ubi .
39
+ docker build --label release=$RELEASE -f ./docker/Dockerfile -t $EXPORTER_NAME:$VERSION --target ${{ matrix.docker }} .
37
40
38
41
- name : Scan local image
39
42
id : scan-local
44
47
ignore-failed-scan : true
45
48
input-type : docker-daemon
46
49
run-as-user : root
47
- - name : Scan local image 2
48
- id : scan-local2
49
- uses : sysdiglabs/scan-action@v3
50
- with :
51
- image-tag : " redis-exporter:latest-ubi"
52
- sysdig-secure-token : ${{ secrets.SYSDIG_SECURE_TOKEN }}
53
- ignore-failed-scan : true
54
- input-type : docker-daemon
55
- run-as-user : root
56
50
57
51
- name : Sarif report
58
52
uses : github/codeql-action/upload-sarif@v1
@@ -63,12 +57,10 @@ jobs:
63
57
- name : Change the tag of the image
64
58
run : |
65
59
docker tag $EXPORTER_NAME:$VERSION artifactory.internal.sysdig.com/$EXPORTER_NAME:$VERSION
66
- docker tag $EXPORTER_NAME:$VERSION-ubi artifactory.internal.sysdig.com/$EXPORTER_NAME:$VERSION-ubi
67
60
68
61
- name : Push the image
69
62
run : |
70
63
docker push artifactory.internal.sysdig.com/$EXPORTER_NAME:$VERSION
71
- docker push artifactory.internal.sysdig.com/$EXPORTER_NAME:$VERSION-ubi
72
64
73
65
- name : Fake Upload master to Quay.io
74
66
uses : fjogeleit/http-request-action@master
0 commit comments