image: 'node:10.15.3'
pipelines:
  branches:
    master:
      - step:
          caches:
            - node
          name: Running UNIT TEST
          script:
            - ls
      - step:
          name: Build JS Files & Documentation
          script:
            - npm i
            - npm i typescript -g
            - git remote set-url origin ${BITBUCKET_GIT_SSH_ORIGIN}
            - git pull
            - npm run docmarkdown
            - git add docs
            - git commit -m "BP-31 Added Auto genrated doc [skip ci]"
            - git push
      - step:
          name: Publish to NPM
          script:
            - npm i
            - npm run build-ts
            - pipe: atlassian/npm-publish:0.2.0
              variables:
                NPM_TOKEN: $NPM_TOKEN
