image: node:8.11.2 stages: - build - publish cache: key: "$CI_PROJECT_NAME" paths: - node_modules/ build: stage: build script: - pwd - npm config set registry https://registry.npm.taobao.org - npm install - npm update - npm run build - ls lib artifacts: name: "lib" paths: - lib expire_in: 1 day only: - master publish: stage: publish script: - ls lib - npm config set registry https://registry.npm.taobao.org - npm install -g npm-cli-login - npm config set registry https://registry.npmjs.org - npm-cli-login -u ${CI_NPM_USER} -p ${CI_NPM_PASS} -e ${CI_NPM_MAIL} - npm publish --access public only: - master when: manual