Skip to content

Instantly share code, notes, and snippets.

@constgen
Last active January 1, 2021 18:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save constgen/f22186b160d0fb6b8472bd83252ba0d5 to your computer and use it in GitHub Desktop.
Save constgen/f22186b160d0fb6b8472bd83252ba0d5 to your computer and use it in GitHub Desktop.
GitLab publish to NPM
image: node:12
cache:
paths:
- node_modules/
stages:
- setup
- test
- deploy
install:
stage: setup
script:
- npm install
after_script:
- npm run postinstall
test:
stage: test
script:
- npm run test
publish:
stage: deploy
only:
- tags
# - triggers
except:
- branches
before_script:
# - npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
- echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}">.npmrc
script:
- npm publish
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment