Skip to content

Commit f798ba0

Browse files
committed
Change workflow of build
1 parent 985c866 commit f798ba0

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

.github/workflows/image-builder-workflow.yaml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,15 @@ on:
1010
jobs:
1111
# This workflow contains a single job called "build"
1212
build:
13+
strategy:
14+
matrix:
15+
docker: ['scratch','ubi']
1316
env:
1417
VERSION: latest
1518
EXPORTER_NAME: redis-exporter
1619
# The type of runner that the job will run on
1720
runs-on: ubuntu-latest
21+
name: ${{ matrix.docker }}
1822
steps:
1923
- name: Checkout
2024
uses: actions/checkout@v2
@@ -32,8 +36,7 @@ jobs:
3236
run: |
3337
docker pull artifactory.internal.sysdig.com/$EXPORTER_NAME:$VERSION
3438
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 }} .
3740
3841
- name: Scan local image
3942
id: scan-local
@@ -44,15 +47,6 @@ jobs:
4447
ignore-failed-scan: true
4548
input-type: docker-daemon
4649
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
5650

5751
- name: Sarif report
5852
uses: github/codeql-action/upload-sarif@v1
@@ -63,12 +57,10 @@ jobs:
6357
- name: Change the tag of the image
6458
run: |
6559
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
6760
6861
- name: Push the image
6962
run: |
7063
docker push artifactory.internal.sysdig.com/$EXPORTER_NAME:$VERSION
71-
docker push artifactory.internal.sysdig.com/$EXPORTER_NAME:$VERSION-ubi
7264
7365
- name: Fake Upload master to Quay.io
7466
uses: fjogeleit/http-request-action@master

0 commit comments

Comments
 (0)