From 2c86b71182efb6448ef633a03581270a403eda76 Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Wed, 17 Apr 2024 09:43:32 -0300 Subject: [PATCH] Build the right image in CI --- .github/workflows/docker-image.yml | 7 ++++--- Dockerfile | 2 +- docker-build.sh | 2 ++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 8b8e3db..9c48fc4 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -1,16 +1,17 @@ name: Docker Image CI -on: [push, pull_request] +on: [push] jobs: build: + name: Build & Test runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Build the Docker image - run: ./docker-build.sh + run: ./docker-build.sh "${GITHUB_REF#refs/heads/}" - name: Run tests - run: docker run --rm -e PROCESS_TYPE=test --name django-coleman mrsarm/django-coleman + run: docker run --rm -e PROCESS_TYPE=test --name django-coleman "mrsarm/django-coleman:${GITHUB_REF#refs/heads/}" diff --git a/Dockerfile b/Dockerfile index c4c66da..9df4fdd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.11-slim +FROM python:3.11-slim-bookworm LABEL maintainer="Mariano Ruiz " ENV CXXFLAGS="-mtune=intel -Os -pipe" \ diff --git a/docker-build.sh b/docker-build.sh index 04984b7..730617d 100755 --- a/docker-build.sh +++ b/docker-build.sh @@ -19,5 +19,7 @@ GIT_HASH_SHORT=$(git rev-parse --short "$GIT_HASH") export BUILD=${GIT_BRANCH}.${GIT_HASH_SHORT} echo "Building mrsarm/django-coleman:${TAG} with image_build $BUILD ..." + +set -x #docker-compose build docker build --build-arg=BUILD="$BUILD" -t mrsarm/django-coleman:${TAG} .