Skip to content

Docker Image

Docker Image #1216

Workflow file for this run

name: Docker Image
on:
schedule:
- cron: "0 10 * * *" # everyday at 10am
pull_request:
branches: ["latest"]
push:
branches: ["latest"]
tags: ["v*.*.*"]
env:
platforms: linux/amd64
jobs:
main:
runs-on: ubuntu-22.04
timeout-minutes: 20
steps:
- name: Check out the repo
uses: actions/checkout@v6
with:
ref: ${{ github.head_ref || github.ref }}
- name: Set imageName based on the repository name
id: step_one
run: |
imageName="${GITHUB_REPOSITORY/docker-/}"
echo $imageName
echo "imageName=$imageName" >> $GITHUB_ENV
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v5
with:
images: ${{ env.imageName }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v6
with:
platforms: ${{ env.platforms }}
push: ${{ github.event_name != 'pull_request' }}
pull: true
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
- name: Docker Scout
id: docker-scout-cves
if: ${{ github.event_name != 'pull_request' }}
uses: docker/scout-action@v1
with:
command: cves
organization: beevelop
image: ${{ env.imageName }}:latest
to-latest: true
github-token: ${{ secrets.GITHUB_TOKEN }} # to be able to write the comment
sarif-file: sarif.output.json
- name: Upload SARIF result
id: upload-sarif
if: ${{ github.event_name != 'pull_request' }}
uses: github/codeql-action/upload-sarif@v4
with:
sarif_file: sarif.output.json
- name: Compare to deployed image
id: docker-scout-compare
if: ${{ github.event_name == 'pull_request' }}
uses: docker/scout-action@v1
with:
command: compare
organization: beevelop
image: ${{ steps.docker_meta.outputs.tags }}
only-severities: critical,high
platform: "linux/amd64"
exit-on: vulnerability,policy
summary: true