From ec21259bb21d531b3187435811faf43693534127 Mon Sep 17 00:00:00 2001 From: MDLeom <2809763-curben@users.noreply.gitlab.com> Date: Sat, 12 Dec 2020 14:15:39 +0000 Subject: [PATCH] ci(gitlab): trigger job in curben/curben.gitlab.io - https://docs.gitlab.com/ee/ci/multi_project_pipelines.html - also dedup rules:if conditions --- .gitlab-ci.yml | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index eb88e72..ec78c67 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,7 +7,10 @@ cache: # add cache to 'node_modules' for speeding up builds variables: NODE_ENV: "production" -pages: +## Rename to 'pages' for gitlab pages +test: + stage: test + before_script: - apk update && apk add git - npm install @@ -17,21 +20,25 @@ pages: - npm run build # Generate site rules: - # Skip in renovate job - - if: '$RENOVATE == "true"' - when: never - # Only trigger through push event in master branch - - if: '$CI_COMMIT_REF_NAME == "master" && $CI_PIPELINE_SOURCE == "push"' - when: always - # Only trigger through "Run pipeline" in master branch - - if: '$CI_COMMIT_REF_NAME == "master" && $CI_PIPELINE_SOURCE == "web"' + # Only trigger through push & "Run pipeline" events in master branch; Skip in renovate job + - if: '$RENOVATE != "true" && $CI_COMMIT_REF_NAME == "master" && ($CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "web")' when: always - ## Uncomment below to enable GitLab Pages + ## Uncomment below to enable gitlab pages # artifacts: # paths: # - public # deploy from the 'public' folder. +deploy: # Trigger deploy job on curben/curben.gitlab.io + stage: deploy + trigger: + project: curben/curben.gitlab.io + branch: master + strategy: depend + rules: + - if: '$RENOVATE != "true" && $CI_COMMIT_REF_NAME == "master" && ($CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "web")' + when: always + renovate: # Check dependency update before_script: - apk update && apk add git @@ -42,9 +49,5 @@ renovate: # Check dependency update - npm run renovate rules: - # Only trigger when environment variable matches and through schedule in master branch - - if: '$RENOVATE == "true" && $CI_COMMIT_REF_NAME == "master" && $CI_PIPELINE_SOURCE == "schedule"' - when: always - # Only trigger when environment variable matches and through "Run pipeline" in master branch - - if: '$RENOVATE == "true" && $CI_COMMIT_REF_NAME == "master" && $CI_PIPELINE_SOURCE == "web"' + - if: '$RENOVATE == "true" && $CI_COMMIT_REF_NAME == "master" && ($CI_PIPELINE_SOURCE == "schedule" || $CI_PIPELINE_SOURCE == "web")' when: always