kind: pipeline
name: default

steps:
  - name: restore-cache
    image: drillster/drone-volume-cache
    pull: true
    when:
      event: [push, pull_request, tag, deployment]
    volumes:
      - name: cache
        path: /cache
    settings:
      restore: true
      mount:
        - ./node_modules

  - name: setup
    image: node:6
    when:
      event: [push, pull_request, tag, deployment]
    commands:
      - npm install

  - name: test
    image: node:6
    group: testing
    when:
      event: [push, pull_request, tag, deployment]
    commands:
      - npm test

  - name: build
    image: node:6
    group: testing
    when:
      event: [push, pull_request, tag, deployment]
    commands:
      - npm run build:prod

  - name: rebuild-cache
    image: drillster/drone-volume-cache
    pull: true
    when:
      event: [push, pull_request, tag, deployment]
    volumes:
      - name: cache
        path: /cache
    settings:
      rebuild: true
      mount:
        - ./node_modules

  - name: deploy
    image: appleboy/drone-ssh
    pull: true
    secrets: [ssh_key]
    when:
      event: push
      branch: master
      status: success
    settings:
      host: nansen.online.ntnu.no
      port: 22
      username: root
      key:
        from_secret: ssh_key
      command_timeout: 600s
      script:
        - /srv/www/splash/deploy.sh

kind: pipeline
name: default

steps:
  - name: restore-cache
    image: drillster/drone-volume-cache
    pull: true
    when:
      event: [push, pull_request, tag, deployment]
    volumes:
      - name: cache
        path: /cache
    settings:
      restore: true
      mount:
        - ./node_modules

  - name: setup
    image: node:6
    when:
      event: [push, pull_request, tag, deployment]
    commands:
      - yarn

  - name: test
    image: node:6
    group: testing
    when:
      event: [push, pull_request, tag, deployment]
    commands:
      - yarn test

  - name: build
    image: node:6
    group: testing
    when:
      event: [push, pull_request, tag, deployment]
    commands:
      - yarn build

  - name: rebuild-cache
    image: drillster/drone-volume-cache
    pull: true
    when:
      event: [push, pull_request, tag, deployment]
    volumes:
      - name: cache
        path: /cache
    settings:
      rebuild: true
      mount:
        - ./node_modules

  - name: deploy
    image: appleboy/drone-ssh
    pull: true
    secrets: [ssh_key]
    when:
      event: push
      branch: master
      status: success
    settings:
      host: nansen.online.ntnu.no
      port: 22
      username: root
      key:
        from_secret: ssh_key
      command_timeout: 600s
      script:
        - /srv/www/splash/deploy.sh

Make Drone use yarn instead of NPM
Make Drone use yarn instead of NPM
