Skip to content

docker-build

docker-build #128

Workflow file for this run

name: docker-build
on:
push:
pull_request:
types:
- opened
- synchronize
- labeled
- reopened
schedule:
- cron: '0 7 * * *'
workflow_dispatch:
jobs:
build:
name: docker-build
runs-on: ubuntu-latest
env:
IMAGE_NAME: nicholasdille/minecraft
SOURCE_DATE_EPOCH: 0
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: uniget-bot
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build
uses: docker/build-push-action@v5
with:
platforms: linux/amd64 #,linux/arm64
provenance: true
sbom: true
cache-from: ghcr.io/${{ env.IMAGE_NAME }}:latest
push: ${{ github.event_name != 'pull_request' }}
tags: ghcr.io/${{ env.IMAGE_NAME }}:latest
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: ghcr.io/${{ env.IMAGE_NAME }}:latest
format: 'table'
#exit-code: '1'
ignore-unfixed: true
severity: 'CRITICAL,HIGH'