feat: Add Docker and GitHub Actions for CI/CD

This commit is contained in:
2025-10-13 18:26:24 +02:00
parent 22badaf535
commit 1f49caa472
4 changed files with 249 additions and 35 deletions

40
.github/workflows/docker-publish.yml vendored Normal file
View File

@@ -0,0 +1,40 @@
name: Publish Docker Image to GitHub Packages
# Run this workflow on every push to the main branch
on:
push:
branches: [ main ]
jobs:
build-and-publish:
runs-on: ubuntu-latest
# Grant permissions for the GITHUB_TOKEN to push to the GitHub Container Registry
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to the GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
- 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 }}```