added Docker Image Build Workflow
Some checks failed
Docker Image Build & Push / push_to_registry (push) Failing after 15m56s

This commit is contained in:
2025-12-08 18:30:28 +01:00
parent d7a737daac
commit 86219b0c00

View File

@@ -0,0 +1,45 @@
name: Docker Image Build & Push
on:
push:
branches:
- 'main' # Baut bei jedem Commit auf main
release:
types: [published] # Baut bei jedem neuen Release
jobs:
push_to_registry:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v4
# 1. Login in die Gitea Container Registry
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: gitea.penry.de # <-- HIER DEINE GITEA URL ANPASSEN (ohne https://)
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# 2. Metadaten extrahieren (Das ist der magische Teil)
# Er sorgt dafür, dass bei einem Commit das Tag "main" oder "latest" genutzt wird
# und bei einem Release das Tag "v1.2.3"
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: gitea.penry.de/${{ github.repository }}
# 3. Bauen und Pushen
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}