Skip to content

Commit

Permalink
ci: add container scanning to default checks
Browse files Browse the repository at this point in the history
Fixes hyperledger#1876

Signed-off-by: zondervancalvez <zondervan.v.calvez@accenture.com>
  • Loading branch information
zondervancalvez committed May 6, 2022
1 parent 1328efb commit eea5e89
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions .github/workflows/azure-container-scan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ on:
tags:
- v*

env:
IMAGE_NAME_1: cactus-whitepaper
IMAGE_NAME_2: cactus-cmd-api-server

jobs:
build-secure-and-push:
Expand All @@ -33,14 +30,14 @@ jobs:


- name: Build Image from Dockerfile
run: DOCKER_BUILDKIT=1 docker build -f $DOCKERFILE_PATH -t $IMAGE_NAME_1 .
run: DOCKER_BUILDKIT=1 docker build -f ./whitepaper/Dockerfile -t cactus-whitepaper .

- uses: Azure/container-scan@v0.1
name: Scan image for vulnerabilities
id: container-scan
continue-on-error: true
with:
image-name: $IMAGE_NAME_1
image-name: cactus-whitepaper


build-secure-and-push-2:
Expand All @@ -51,20 +48,18 @@ jobs:
env:
# (Required) The token to use to make API calls to GitHub.
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
DOCKER_BUILDKIT: 1
DOCKERFILE_PATH: ./packages/cactus-cmd-api-server/Dockerfile

- uses: actions/checkout@v1
- name: Login to DockerHub Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin


- name: Build Images from Dockerfile
run: DOCKER_BUILDKIT=1 docker build -f $DOCKERFILE_PATH -t $IMAGE_NAME_2 .
run: DOCKER_BUILDKIT=1 docker build -f ./packages/cactus-cmd-api-server/Dockerfile -t cactus-cmd-api-server .

- uses: Azure/container-scan@v0.1
name: Scan image for vulnerabilities
id: container-scan
continue-on-error: true
with:
image-name: $IMAGE_NAME_2
image-name: cactus-cmd-api-server

0 comments on commit eea5e89

Please sign in to comment.