Create trivy.yml #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Scan Docker Images | ||
on: | ||
push: | ||
branches: | ||
- develop | ||
pull_request: | ||
branches: | ||
- develop | ||
jobs: | ||
build-dockers: | ||
strategy: | ||
matrix: | ||
include: | ||
- SERVICE_LOCATION: 'admin/admin-service' | ||
SERVICE_NAME: 'admin-service' | ||
BUILD_ARTIFACT: 'admin' | ||
- SERVICE_LOCATION: 'admin/hotlist-service' | ||
SERVICE_NAME: 'hotlist-service' | ||
BUILD_ARTIFACT: 'admin' | ||
- SERVICE_LOCATION: 'admin/kernel-masterdata-service' | ||
SERVICE_NAME: 'kernel-masterdata-service' | ||
BUILD_ARTIFACT: 'admin' | ||
- SERVICE_LOCATION: 'admin/kernel-syncdata-service' | ||
SERVICE_NAME: 'kernel-syncdata-service' | ||
BUILD_ARTIFACT: 'admin' | ||
fail-fast: false | ||
name: ${{ matrix.SERVICE_NAME }} | ||
uses: mosip/kattu/.github/workflows/docker-build.yml@master | ||
Check failure on line 30 in .github/workflows/trivy.yml GitHub Actions / Build and Scan Docker ImagesInvalid workflow file
|
||
with: | ||
SERVICE_LOCATION: ${{ matrix.SERVICE_LOCATION }} | ||
SERVICE_NAME: ${{ matrix.SERVICE_NAME }} | ||
BUILD_ARTIFACT: ${{ matrix.BUILD_ARTIFACT }} | ||
secrets: | ||
DEV_NAMESPACE_DOCKER_HUB: ${{ secrets.DEV_NAMESPACE_DOCKER_HUB }} | ||
scan-dockers: | ||
needs: build-dockers | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
include: | ||
- SERVICE_NAME: 'admin-service' | ||
- SERVICE_NAME: 'hotlist-service' | ||
- SERVICE_NAME: 'kernel-masterdata-service' | ||
- SERVICE_NAME: 'kernel-syncdata-service' | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Install Trivy | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y wget apt-transport-https gnupg lsb-release | ||
wget -qO - https://aquasecurity.github.io/trivy-repo/deb/public.key | sudo apt-key add - | ||
echo deb https://aquasecurity.github.io/trivy-repo/deb $(lsb_release -sc) main | sudo tee -a /etc/apt/sources.list.d/trivy.list | ||
sudo apt-get update | ||
sudo apt-get install -y trivy | ||
- name: Scan Docker image | ||
run: trivy image ${{ secrets.DEV_NAMESPACE_DOCKER_HUB }}/${{ matrix.SERVICE_NAME }}:latest |