Skip to content

Merge pull request #11 from wozniakpl/trivy #31

Merge pull request #11 from wozniakpl/trivy

Merge pull request #11 from wozniakpl/trivy #31

Workflow file for this run

name: docker-nginx
on:
push:
tags:
- v*
jobs:
main:
runs-on: ubuntu-22.04
steps:
- uses: FranzDiebold/github-env-vars-action@v2
- name: Checkout
uses: actions/checkout@v3
- name: Prepare docker buildx
uses: docker/setup-buildx-action@v2
- name: Login to ghcr.io
run: echo "${{ secrets.DOCKER_HUB_PASS }}" | docker login -u ${{ secrets.DOCKER_HUB_USER }} --password-stdin
- name: Build Docker image
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: tivix/docker-nginx:${{ github.sha }}, tivix/docker-nginx:${{ env.CI_REF_NAME }}
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: 'tivix/docker-nginx:${{ github.sha }}'
format: 'table'
exit-code: '1'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH'