kind: pipeline
type: docker
name: default
   
steps:
  - name: install
    image: node:14
    commands:
      - npm install

  - name: build
    image: node:14
    commands:
      - npm run build:production
    when:
      branch:
      - main
      - dev

  - name: build-npm
    image: node:14
    commands:
      - npm run build:production
    when:
      event:
      - tag

  - name: test
    image: node:14
    commands:
      - npm run test
    when:
      branch:
      - main
      - dev

  - name: docs
    image: node:14
    commands:
      - npm run docs:production
    when:
      branch:
      - main
      - dev

  - name: npm
    image: plugins/npm
    settings:
      token: 
        from_secret: npm_token
      email: 
        from_secret: npm_email
    when:
      event:
      - tag

