From 22b48134a1f7de5fd4a2b4bcfe0d67e0a89eee6e Mon Sep 17 00:00:00 2001 From: Lambert Theisen <lambert.theisen@rwth-aachen.de> Date: Wed, 30 Oct 2024 16:39:49 +0100 Subject: [PATCH] try to add Docker image building in CI --- .gitlab-ci.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5841591..1f1bce1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,9 +1,24 @@ image: python:3.9 # Use a Python Docker image stages: # Define stages in the pipeline + - prepare - build - deploy +prepare: + image: docker:20.10.16 + stage: build + services: + - docker:20.10.16-dind + before_script: + - echo "$CI_REGISTRY_PASSWORD" | docker login $CI_REGISTRY -u $CI_REGISTRY_USER --password-stdin + script: + - docker pull $CI_REGISTRY_IMAGE:latest || true + - docker build + --cache-from $CI_REGISTRY_IMAGE:latest + --tag $CI_REGISTRY_IMAGE:latest . + - docker push $CI_REGISTRY_IMAGE:latest + # Job to build documentation build-docs: stage: build @@ -23,4 +38,4 @@ pages: paths: - public # Files in the "public" folder will be deployed to GitLab Pages only: - - main # Only deploy if the changes are in the default branch \ No newline at end of file + - main # Only deploy if the changes are in the default branch -- GitLab