gitlab-ci: Build on merge request, upload only on main branch commits

This commit is contained in:
Timothée Ravier 2024-07-12 13:06:22 +02:00
parent 0fb6521f83
commit 21ba138fa9

View file

@ -3,6 +3,7 @@
# Only used in https://gitlab.com/fedora/ostree/ci-test # Only used in https://gitlab.com/fedora/ostree/ci-test
# For tests running in the Fedora infrastructure, see .zuul.yaml and # For tests running in the Fedora infrastructure, see .zuul.yaml and
# https://fedoraproject.org/wiki/Zuul-based-ci # 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 # See: https://gitlab.com/fedora/ostree/buildroot
image: quay.io/fedora-ostree-desktops/buildroot image: quay.io/fedora-ostree-desktops/buildroot
@ -10,8 +11,29 @@ image: quay.io/fedora-ostree-desktops/buildroot
stages: stages:
- build - build
# As those are not official images, we build all available variants # Only build the images for merge requests
build: 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 stage: build
script: script:
- just compose-image $VARIANT - just compose-image $VARIANT
@ -30,3 +52,5 @@ build:
- cosmic-atomic - cosmic-atomic
# - kinoite-nightly # - kinoite-nightly
# - kinoite-devel # - kinoite-devel
rules:
- if: $CI_COMMIT_BRANCH == "main" && ($CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "schedule")