kind: pipeline
name: default

steps:
  - name: Compile site
    image: node:lts
    commands:
      - yarn
      - npx harp ./ ./dist
    volumes:
      - name: cache
        path: /drone/src/node_modules

  - name: Deploy
    image: drillster/drone-rsync
    settings:
      user:
        from_secret: shikoku_ssh_user
      key:
        from_secret: shikoku_ssh_key
      hosts:
        from_secret: shikoku_ssh_hostname
      source: ./dist/*
      target: ~/sites/undersco.re
      secrets:
        [shikoku_ssh_key, shikoku_ssh_hostname, shikoku_ssh_user, shikoku_ssh_port]
      port:
        from_secret: shikoku_ssh_port
    when:
      branch:
        - main
      event:
        - push
        - custom

volumes:
  - name: cache
    host:
      path: /tmp/drone/cache/ndc_org/node_modules
