From ae25b5fd18803c0005498eea218a7188c2d005bc Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Wed, 16 Apr 2025 20:36:17 +0200 Subject: [PATCH] CI: Do not rebuild Docker images for test builds for new branches New branch considers all files changed. We don't want to rebuild all docker images for new branches; that's just a waste of time and energy. There is a better way for future -- a much better fine-grained control may be obtained by running secondary pipelines. fixes #212 --- .gitlab-ci.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 59afb1d97..58726a240 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -44,13 +44,19 @@ stages: # That's Docker in Docker - dind rules: - - if: '$CI_COMMIT_TAG' # Never rebuild for tags + - if: '$CI_COMMIT_TAG' when: never - - changes: + + # Never rebuild for new branches + - if: $CI_COMMIT_BEFORE_SHA == "0000000000000000000000000000000000000000" + when: never + # Do any change in Dockerfile (e.g. change a comment) to rebuild the image + - changes: - misc/docker/$IMG_NAME/Dockerfile when: always + - when: never docker-docbuilder: -- 2.47.3