Skip to content

Container Image Builds #4

Container Image Builds

Container Image Builds #4

Workflow file for this run

name: Container Image Builds
on:
push:
branches: [ main ]
tags: ["v*"]
workflow_dispatch:
jobs:
images:
name: Build images
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ vars.IMAGE_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Setup container meta information
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ vars.IMAGE_REGISTRY }}/${{ github.repository }}
labels: |
org.opencontainers.image.vendor=Greenbone
org.opencontainers.image.base.name=debian:stable-slim
tags: |
# create container tag for git tags
type=ref,event=tag
# set edge for default branch
type=edge
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Container image
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
file: docker/Dockerfile
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}