From 55a9a0ea75a108329b0ef3a0b85f3ffb820ceb0c Mon Sep 17 00:00:00 2001 From: Jan <157487559+JTaeuber@users.noreply.github.com> Date: Wed, 26 Feb 2025 09:29:24 +0100 Subject: [PATCH] Fix/workflows (#132) * fix: poetry command in dockerfile * refactor: change workflow to only run on tags --- .github/workflows/docker-build.yml | 26 ++++++-------------------- Dockerfile | 2 +- 2 files changed, 7 insertions(+), 21 deletions(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index d4f01f2..c16eb28 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -1,8 +1,9 @@ -# Build and push Image name: Build and push Image on: push: + tags: + - "*" jobs: build: @@ -16,22 +17,7 @@ jobs: uses: nowsprinting/check-version-format-action@v4.0.2 id: check-version with: - prefix: 'v' - - - name: Set tag - id: set-tag - run: | - SHORT_SHA=$(git rev-parse --short HEAD) - TAG1="dev" - TAG2="commit-$SHORT_SHA" - - if [[ "${{ steps.check-version.outputs.is_valid }}" == 'true' ]]; then - TAG1="latest" - TAG2="${{ steps.check-version.outputs.full_without_prefix }}" - fi - - echo "TAG1=$TAG1" >> $GITHUB_ENV - echo "TAG2=$TAG2" >> $GITHUB_ENV + prefix: "v" - name: Docker meta id: meta @@ -41,13 +27,13 @@ jobs: mtr.devops.telekom.de/caas/py-kube-downscaler ghcr.io/caas-team/py-kube-downscaler tags: | - ${{ env.TAG1 }} - ${{ env.TAG2 }} + "latest" + ${{ steps.check-version.outputs.full_without_prefix }} - name: Install Cosign uses: sigstore/cosign-installer@main with: - cosign-release: 'v2.2.0' + cosign-release: "v2.2.0" - name: Set up QEMU uses: docker/setup-qemu-action@v3 diff --git a/Dockerfile b/Dockerfile index 8486000..6fc1583 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,7 @@ COPY poetry.lock / COPY pyproject.toml / RUN poetry config virtualenvs.create false && \ - poetry install --no-interaction --no-dev --no-ansi + poetry install --no-interaction --without dev --no-ansi FROM python:3.12.9-alpine3.20