💡
Continuous Integrations for NPM Publish
  • README
  • Github Actions
  • Travis CI
  • Gitlab CI
  • Wercker
  • Bitbucket Pipelines
  • CircleCI
  • Contributor Covenant Code of Conduct
  • Contributing
Powered by GitBook
On this page
  • Create file config:
  • Copy the content and paste in .gitlab.yml
  • Example Projects

Was this helpful?

Gitlab CI

PreviousTravis CINextWercker

Last updated 5 years ago

Was this helpful?

[Site](https://docs.gitlab.com/ee/ci/) | [Example](examples/.gitlab.yml)

Create file config:

touch .gitlab-ci.yml

Copy the content and paste in .gitlab.yml

image: node:latest

stages:
  - build
  - deploy

build:
  stage: build
  script:
    - yarn install
    - yarn build
  artifacts:
    expire_in: 1 hour
    paths:
      - dist/
      - node_modules/
  only:
    - tags

deploy:
  stage: deploy
  script:
    - echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" >> $HOME/.npmrc 2> /dev/null
    - npm publish
  only:
    - tags
  dependencies:
    - build

Example Projects

If you use this CI format, enter your project here.

Gitlab CI logo