image: node:10.15.1

pipelines:
  custom:
    deploy:
      - step:
          caches:
            - node
          name: Build and Test
          script:
            - npm install
            - npm test
      - step:
          name: Publish
          deployment: production
          caches:
            - node
          script:
            - npm version
            - pipe: atlassian/npm-publish:0.2.0
              variables:
                NPM_TOKEN: $NPM_TOKEN
      # npm login
      # npm unpublish admin-lte-ng@number
  default:
    - step:
        caches:
          - node
        script: # Modify the commands below to build your repository.
          - npm install
          - npm test
