ci(gitlab): trigger job in curben/curben.gitlab.io

- https://docs.gitlab.com/ee/ci/multi_project_pipelines.html
- also dedup rules:if conditions
This commit is contained in:
MDLeom 2020-12-12 14:15:39 +00:00
parent 4289211a09
commit ec21259bb2
No known key found for this signature in database
GPG Key ID: 32D3E28E96A695E8
1 changed files with 18 additions and 15 deletions

View File

@ -7,7 +7,10 @@ cache: # add cache to 'node_modules' for speeding up builds
variables: variables:
NODE_ENV: "production" NODE_ENV: "production"
pages: ## Rename to 'pages' for gitlab pages
test:
stage: test
before_script: before_script:
- apk update && apk add git - apk update && apk add git
- npm install - npm install
@ -17,21 +20,25 @@ pages:
- npm run build # Generate site - npm run build # Generate site
rules: rules:
# Skip in renovate job # Only trigger through push & "Run pipeline" events in master branch; Skip in renovate job
- if: '$RENOVATE == "true"' - if: '$RENOVATE != "true" && $CI_COMMIT_REF_NAME == "master" && ($CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "web")'
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"'
when: always when: always
## Uncomment below to enable GitLab Pages ## Uncomment below to enable gitlab pages
# artifacts: # artifacts:
# paths: # paths:
# - public # deploy from the 'public' folder. # - 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 renovate: # Check dependency update
before_script: before_script:
- apk update && apk add git - apk update && apk add git
@ -42,9 +49,5 @@ renovate: # Check dependency update
- npm run renovate - npm run renovate
rules: 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" || $CI_PIPELINE_SOURCE == "web")'
- 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"'
when: always when: always