Skip to content

fix trivy env for db #23

fix trivy env for db

fix trivy env for db #23

name: Docker
on:
push:
branches: ["master"]
jobs:
build:
name: Build & puch docker image
runs-on: ubuntu-latest
env:
IMG_NAME: ${{ github.repository }}
IMG_VERSION: 0.0.3
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build docker image
run: docker build -t docker.io/${{ github.repository }}:${{ env.IMG_VERSION }} .
- name: Run Trivy vulnerability scanner
uses: aquasecurity/[email protected]
with:
image-ref: 'docker.io/${{ github.repository }}:${{ env.IMG_VERSION }}'
format: 'table'
env:
TRIVY_DB_REPOSITORY: 'public.ecr.aws/aquasecurity/trivy-db,aquasec/trivy-db,ghcr.io/aquasecurity/trivy-db'
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64, linux/arm64
push: true
tags: '${{ github.repository }}:${{ env.IMG_VERSION }}'