blog/.gitlab-ci.yml

34 lines
792 B
YAML
Raw Normal View History

# Use latest version of Node.js
image: node:latest
2016-02-29 14:25:06 +00:00
stages:
- test
- deploy
cache: # add cache to 'node_modules' for speeding up builds
paths:
- node_modules/ # Node modules and dependencies
2016-02-29 14:25:06 +00:00
snyk-test:
stage: test
script:
- npm install # install node modules
2018-09-25 01:39:12 +00:00
- npm install -g snyk
- snyk auth $SNYK_TOKEN
- snyk protect # Apply patches to node modules
2018-09-25 01:39:12 +00:00
- snyk test # Check node modules for vulnerability
only:
- master
pages:
stage: deploy
script:
2018-09-25 01:39:12 +00:00
- npm install -g hexo-cli
- hexo deploy # deploy the site
- find public -type f -iregex '.*\.\(htm\|html\|txt\|text\|js\|css\)$' -execdir gzip -f --keep {} \; # Compress files
2016-02-29 14:25:06 +00:00
artifacts:
paths:
- public # deploy to the 'public' folder
only:
- master
when: on_success