# This is a build configuration for master/staging branches
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
# We can separate the Demo/Production steps if needed in the future
# -----
# There is an "empty" step on master because bitbucket requires a step
# without a manual trigger to be executed first
image: node:8.10.0

pipelines:
   branches:
      master:
       - step:
           name: "Publish to NPM"
           caches:
             - node
           script:
             - mv .npmrc_config .npmrc
             - npm install
             - npm publish --access public
      staging:
       - step:
           name: "Publish to NPM"
           caches:
             - node
           script:
             - mv .npmrc_config .npmrc
             - npm install
             - npm publish --access public --tag staging