From 21ba138fa9d44cb351b120c34c9784ce6c342560 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Ravier?= Date: Fri, 12 Jul 2024 13:06:22 +0200 Subject: [PATCH] gitlab-ci: Build on merge request, upload only on main branch commits --- .gitlab-ci.yml | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d461ed9..116e99b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,6 +3,7 @@ # Only used in https://gitlab.com/fedora/ostree/ci-test # For tests running in the Fedora infrastructure, see .zuul.yaml and # https://fedoraproject.org/wiki/Zuul-based-ci +# As those are not official images, we build all available variants # See: https://gitlab.com/fedora/ostree/buildroot image: quay.io/fedora-ostree-desktops/buildroot @@ -10,8 +11,29 @@ image: quay.io/fedora-ostree-desktops/buildroot stages: - build -# As those are not official images, we build all available variants +# Only build the images for merge requests build: + stage: build + script: + - just compose-image $VARIANT + parallel: + matrix: + - VARIANT: + - silverblue + - kinoite + - kinoite-mobile + - sway-atomic + - xfce-atomic + - lxqt-atomic + - budgie-atomic + - base-atomic + # - kinoite-nightly + # - kinoite-devel + rules: + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + +# Build and upload the images for commits pushed to the branch & scheduled pipelines +build-upload: stage: build script: - just compose-image $VARIANT @@ -30,3 +52,5 @@ build: - cosmic-atomic # - kinoite-nightly # - kinoite-devel + rules: + - if: $CI_COMMIT_BRANCH == "main" && ($CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "schedule")