test(docker): build docker by CI

Signed-off-by: Klagarge <remi@heredero.ch>
This commit is contained in:
2025-03-19 22:26:38 +01:00
parent 5e926d7674
commit 4e27f8c9d9

View File

@@ -5,6 +5,7 @@ default:
image: $DOCKER_IMAGE
stages:
- build-docker
- lint
- test
@@ -51,3 +52,21 @@ pages:
expire_in: 7 days
only:
- main
# This job runs only when Dockerfile changes
docker-build:
image: docker:latest
stage: build-docker
services:
- docker:dind
script:
- docker build -t $DOCKER_IMAGE -f Dockerfile .
- echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY
- docker push $DOCKER_IMAGE
rules:
- if: $GITLAB_CI == 'false' # Only run in GitLab CI
when: never
- changes:
- Dockerfile
- src/pyproject.toml
- src/pdm.lock