From 5aa8a55989ea7d534b266ee04f7f901f520733db Mon Sep 17 00:00:00 2001 From: Paul Gierz Date: Thu, 18 Jul 2024 17:01:42 +0200 Subject: [PATCH] ci: adds auto-build via docker --- .github/workflows/docker.yml | 32 ++++++++++++++++++++++++++++++++ Dockerfile | 12 ++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 .github/workflows/docker.yml create mode 100644 Dockerfile diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..74a00cc --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,32 @@ +name: Build and Push Docker Image +on: + push: + branches: + - master +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Login to ghcr.io + uses: docker/login-action@v1 + 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: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + - name: Build and push Docker image + uses: docker/build-push-action@v2 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b5c9ae4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM python:3.12-slim + +RUN apt update && apt upgrade -y && apt install -y git + +WORKDIR /usr/src/app + +COPY . . + +RUN pip install . + +ENTRYPOINT ["metis-wizard"] +CMD [ "--help" ]