---
kind: pipeline
type: docker
name: default

steps:
  - name: ssh commands for rohanverma.net
    image: appleboy/drone-ssh
    when:
      branch:
        - master
    settings:
      host: 159.89.175.2
      username: deploy
      port: 22
      key:
        from_secret: ssh_key
      script_stop: true
      script:
        - cd /home/rhnvrm/apps/rohanverma.net
        - git fetch origin
        - git checkout origin/master
        - cd /home/rhnvrm/proxy
        - docker-compose build rohanvermanet
        - docker-compose up -d rohanvermanet
  - name: ssh commands for next.rohanverma.net
    image: appleboy/drone-ssh
    when:
      branch:
        - develop
    settings:
      host: 159.89.175.2
      username: deploy
      port: 22
      key:
        from_secret: ssh_key
      script_stop: true
      script:
        - cd /home/rhnvrm/apps/next.rohanverma.net
        - git fetch origin
        - git checkout origin/develop
        - cd /home/rhnvrm/proxy
        - docker-compose build nextrohanvermanet
        - docker-compose up -d nextrohanvermanet