From 9ede298e68b32fd86766639421e0ab0a31367c86 Mon Sep 17 00:00:00 2001 From: curben Date: Tue, 25 Sep 2018 10:27:38 +0930 Subject: [PATCH] 'only:' cannot be set globally must be inside a job and must be an array not a string --- .gitlab-ci.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b3b0f70..d8d0f82 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,20 +10,21 @@ cache: # add cache to 'node_modules' for speeding up builds paths: - node_modules/ # Node modules and dependencies -only: - - master # CI will affect only the 'master' branch - build-job: stage: build script: - npm install -g hexo-cli snyk - npm install - snyk auth $SNYK_TOKEN + only: + - master # job will affect only the 'master' branch snyk-test: stage: test script: - snyk test # Test node modules for vulnerability + only: + - master pages: stage: deploy @@ -34,4 +35,6 @@ pages: artifacts: paths: - public # deploy to the 'public' folder + only: + - master when: on_success \ No newline at end of file