I'm trying to build a job that can be conditionally executed depends on whether the files or subdirectories in WebClient
is modified in develop
branch, using rules
. If there are changes found in the develop branch only, then a pipeline will be built.
Currently what I got in my .gitlab-ci.yml
is
deploy_dev_client:
stage: client
tags:
- my tags
script:
- '& cd WebClient'
- 'npm rebuild node-sass'
- 'npm install @angular/cli@7.0.3'
- '& npm run build-release --max_old_space_size=$NODE_MEMORY_SIZE'
rules:
- changes:
- WebClient/**/*
when: always
- when: never
However, after testing, I realized that the pipeline is executed whenever I push something from my local repo to gitlab, even at the other side branches.
I have tried using only:-develop'
, however it results in yaml invalid
error, maybe due to not being able to use only
if rules
has already been used. Is there anyway I can still using rules
to target only develop
branch?