feat: add docker build

This commit is contained in:
Daniel Bauer
2025-07-04 12:52:58 +02:00
parent 0b61b09915
commit 3272f527dd
4 changed files with 129 additions and 67 deletions

View File

@@ -35,3 +35,43 @@ jobs:
- name: Run tests
run: uv run pytest
docker:
runs-on: ubuntu-latest
needs: test
permissions:
contents: read
packages: write
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/cordra-mcp
tags: |
type=ref,event=branch
type=raw,value=latest
- 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 }}
cache-from: type=gha
cache-to: type=gha,mode=max