mirror of
https://github.com/paralus/paralus.git
synced 2026-08-23 21:36:30 +00:00
97 lines
2.7 KiB
YAML
97 lines
2.7 KiB
YAML
name: Scan container images
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
|
|
env:
|
|
REGISTRY: docker.io
|
|
IMAGE_NAME: paralusio/paralus
|
|
TAG: latest
|
|
|
|
jobs:
|
|
|
|
build:
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest]
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v2
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v4
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
|
|
# Sanity check before publishing
|
|
- name: Create k8s Kind Cluster
|
|
uses: helm/kind-action@v1.2.0
|
|
|
|
- name: Test all
|
|
run: go test -v ./...
|
|
|
|
- name: Build docker image
|
|
uses: docker/build-push-action@v4
|
|
with:
|
|
context: .
|
|
platforms: linux/amd64,linux/arm64
|
|
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.TAG }}
|
|
|
|
- name: Run Trivy vulnerability scanner
|
|
uses: aquasecurity/trivy-action@0.10.0
|
|
with:
|
|
image-ref: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.TAG }}
|
|
format: 'table'
|
|
exit-code: '1'
|
|
ignore-unfixed: true
|
|
vuln-type: 'os,library'
|
|
severity: 'CRITICAL,HIGH'
|
|
|
|
- name: Build Docker image (paralus-init)
|
|
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile.initialize
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-init:${{ env.TAG }}
|
|
|
|
- name: Run Trivy vulnerability scanner
|
|
uses: aquasecurity/trivy-action@0.10.0
|
|
with:
|
|
image-ref: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-init:${{ env.TAG }}
|
|
format: 'table'
|
|
exit-code: '1'
|
|
ignore-unfixed: true
|
|
vuln-type: 'os,library'
|
|
severity: 'CRITICAL,HIGH'
|
|
|
|
- name: Build and push Docker image (kratos-sync)
|
|
uses: docker/build-push-action@v4
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile.synchronizer
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
tags: ${{ env.REGISTRY }}/paralusio/kratos-synchronizer:${{ env.TAG }}
|
|
|
|
- name: Run Trivy vulnerability scanner
|
|
uses: aquasecurity/trivy-action@0.10.0
|
|
with:
|
|
image-ref: ${{ env.REGISTRY }}/paralusio/kratos-synchronizer:${{ env.TAG }}
|
|
format: 'table'
|
|
exit-code: '1'
|
|
ignore-unfixed: true
|
|
vuln-type: 'os,library'
|
|
severity: 'CRITICAL,HIGH' |