version: '1.0'

steps:

  install_dependencies:
    title: Installing testing dependencies
    image: codefresh/node-tester-image:8.8.0
    commands:
        - yarn install

  unit_test:
    title: Running unit tests
    image: codefresh/node-tester-image:8.8.0
    commands:
      - yarn run test:unit

  deploy_to_npm:
    title: Publishing To Npm
    image: codefresh/npm-publish:master
    commands:
      - NPM_TOKEN=${{NPM_TOKEN}} npm run ci-publish
    when:
      branch:
        only: [ master ]
