Skip to content

Commit

Permalink
Fix/workflows (#132)
Browse files Browse the repository at this point in the history
* fix: poetry command in dockerfile

* refactor: change workflow to only run on tags
  • Loading branch information
JTaeuber authored Feb 26, 2025
1 parent fa9ddfb commit 55a9a0e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 21 deletions.
26 changes: 6 additions & 20 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Build and push Image
name: Build and push Image

on:
push:
tags:
- "*"

jobs:
build:
Expand All @@ -16,22 +17,7 @@ jobs:
uses: nowsprinting/[email protected]
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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 55a9a0e

Please sign in to comment.