'only:' cannot be set globally

must be inside a job and must be an array not a string
This commit is contained in:
curben 2018-09-25 10:27:38 +09:30
parent 1b594c706e
commit 9ede298e68
1 changed files with 6 additions and 3 deletions

View File

@ -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