blog/.gitlab-ci.yml

56 lines
1.4 KiB
YAML
Raw Normal View History

image: node:alpine # Use latest version of Node.js on Alpine
2016-02-29 14:25:06 +00:00
cache: # add cache to 'node_modules' for speeding up builds
paths:
- node_modules/ # Node modules and dependencies
before_script:
- apk update && apk add git
2019-08-23 02:36:25 +00:00
- npm install --only=prod -g npm
2019-08-23 02:32:37 +00:00
- npm install --only=prod
2016-02-29 14:25:06 +00:00
test:
script:
2019-08-23 02:32:37 +00:00
- npm install --only=prod snyk && npm run snyk # Refer to "scripts" in package.json
- npm run hexo
only:
- master # only trigger when 'master' branch is pushed
# Don't run this job when renovate job runs
except:
- schedules
- web
renovate: # Check dependency update
script:
2019-08-23 02:32:37 +00:00
- npm install --only=prod renovate
- npm run renovate
only:
- schedules # trigger build by schedules
- web # trigger through "Run pipeline" button in GitLab.com
# # Uncomment below (and comment/remove above) lines for gitlab pages
# image: node:latest # Use latest version of Node.js
# pages:
# cache: # add cache to 'node_modules' for speeding up builds
# paths:
# - node_modules/ # Node modules and dependencies
# script:
# - npm install -g snyk hexo-cli
# - npm install # install node modules
# - snyk auth $SNYK_TOKEN
# - snyk protect # Apply patches to node modules
# - snyk test # Check node modules for vulnerability
# - hexo deploy # deploy the site.
# artifacts:
# paths:
# - public # deploy to the 'public' folder.
# only:
# - master # this job will affect only the 'master' branch