image: saidzhu/node:8.10.0 variables: REGISTRY: "https://registry.npmjs.org/" stages: - prepare - build - deploy prepare:dependency: stage: prepare script: - npm install --quiet cache: key: node_module paths: - node_modules only: - branches tags: - docker-local build:all: stage: build cache: key: node_module policy: pull paths: - node_modules before_script: - export BUILD_TASK=$(echo "build:dist") script: - npm run $BUILD_TASK only: - branches tags: - docker-local deploy:npm: stage: deploy before_script: - npm config set registry $REGISTRY - npm-cli-login -u $NPM_NAME -p $NPM_PWD -e $NPM_EMAIL script: - npm publish --access=public when: manual only: - branches tags: - docker-local