Skip to content

Instantly share code, notes, and snippets.

@lguzzon
Forked from thornbill/.gitlab-ci.yml
Created February 4, 2022 14:42
Show Gist options
  • Save lguzzon/6c31fef5d784cac431ae0a51d57688ca to your computer and use it in GitHub Desktop.
Save lguzzon/6c31fef5d784cac431ae0a51d57688ca to your computer and use it in GitHub Desktop.
Example Node GitLab CI Yamlfile
# Official framework image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/node/tags/
image: node:6
before_script:
- npm install
# This folder is cached between builds
# http://docs.gitlab.com/ce/ci/yaml/README.html#cache
cache:
paths:
- node_modules/
test:lint:
script:
- npm run lint
test:vulnerabilities:
script:
- npm run vuln-test
# Supported node versions can be found here:
# https://github.com/nodejs/LTS#lts_schedule
# jest does not support node < 4
# https://facebook.github.io/jest/docs/troubleshooting.html#compatibility-issues
test:node:6:
script:
- npm install -g codecov
- npm run build
- npm test && codecov
test:node:7:
image: node:7
script:
- npm run build
- npm test
test:node:4:
image: node:4
script:
- npm run build
- npm test
# Publish tagged versions to npm
publish:
stage: deploy
only:
- tags
- triggers
script:
- npm run build
- echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}'>.npmrc
- npm publish
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment