diff --git a/.gitlab/ci/rules.gitlab-ci.yml b/.gitlab/ci/rules.gitlab-ci.yml index 726a872dc4d7dd059981b3f8dad96eb6e48ad5f4..1cc32d13b63e62158bfbf03d07742e44bc22699b 100644 --- a/.gitlab/ci/rules.gitlab-ci.yml +++ b/.gitlab/ci/rules.gitlab-ci.yml @@ -46,6 +46,11 @@ .if-default-branch-refs: &if-default-branch-refs if: '$CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH && $CI_MERGE_REQUEST_IID == null' +# This rule ensures the job runs for push pipeline events on stable branches. +# This is used for ensuring jobs run in a pipeline triggered by mirror sync. +.if-sync-changes-on-stable-branches: &if-sync-changes-on-stable-branches + if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_REF_NAME =~ /^[\d-]+-stable(-ee)?$/' + .if-auto-deploy-branches: &if-auto-deploy-branches if: '$CI_COMMIT_BRANCH =~ /^\d+-\d+-auto-deploy-\d+$/' @@ -1121,6 +1126,7 @@ when: never - if: '$ENABLE_BUILD_ASSETS_IMAGE == "true"' - <<: *if-tag + - <<: *if-sync-changes-on-stable-branches - !reference [".frontend:rules:assets-shared", rules] # Always build on stable branches to serve release-environments pipeline # Do not refer directly to .release-environments:rules:start-release-environments-security-pipeline @@ -1339,6 +1345,7 @@ when: never - if: '$ENABLE_COMPILE_PRODUCTION_ASSETS == "true"' - <<: *if-tag + - <<: *if-sync-changes-on-stable-branches - !reference [".frontend:rules:assets-shared", rules] # Always build on stable branches to serve release-environments pipeline # Do not refer directly to .release-environments:rules:start-release-environments-security-pipeline