Skip to content

Commit

Permalink
Build the right image in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
mrsarm committed Apr 17, 2024
1 parent 35dc349 commit 2c86b71
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -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/}"
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.11-slim
FROM python:3.11-slim-bookworm
LABEL maintainer="Mariano Ruiz <[email protected]>"

ENV CXXFLAGS="-mtune=intel -Os -pipe" \
Expand Down
2 changes: 2 additions & 0 deletions docker-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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} .

0 comments on commit 2c86b71

Please sign in to comment.