version: 2
jobs:
  build:
    docker:
      - image: circleci/node:9
    working_directory: ~/app
    steps:
      - checkout
      - run: npm install
      - run:
          name: deploy
          command: |
            if [[ "${CIRCLE_BRANCH}" == "master" ]]; then
              npm run npmrc && npm publish
            fi
