feat: build and release docker images using github cicd

This commit is contained in:
Sebastian Di Luzio 2025-04-06 22:54:21 +02:00
parent d17523ff17
commit 04dd2627cb
2 changed files with 49 additions and 0 deletions

44
.github/workflows/docker-release.yml vendored Normal file
View file

@ -0,0 +1,44 @@
name: build & push docker container
on:
push:
tags:
- '*Release*'
pull_request:
branches:
- master
jobs:
docker:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Docker meta
id: metal
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository }}
- 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
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.metal.outputs.tags }}
labels: ${{ steps.metal.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max