---
include:
    - remote: "https://jobs.just-ci.dev/v5.0.0-beta.10/cd/ssh/ssh.yml"
    - remote: "https://jobs.just-ci.dev/v5.0.0-beta.10/cd/ssh/docker-login.yml"
    - remote: "https://jobs.just-ci.dev/v5.0.0-beta.10/cd/ssh/make.yml"
    - remote: "https://jobs.just-ci.dev/v5.0.0-beta.10/cd/ssh/scp.yml"

variables:
    REMOTE_USER: ubuntu
    REMOTE_HOST: x.x.x.x
    SCP_REMOTE_DEST_DIR: /home/ubuntu

stages:
    - deliver
    - configure
    - deploy

scp:
    stage: deliver

docker:login:
    stage: configure

deploy:make:
    stage: deploy

.ssh:
    rules:
        - if: '$CI_COMMIT_TAG'
          when: never
        - if: '$CI_COMMIT_REF_PROTECTED'
          variables:
              MAKE_EXTRA_ARGS: 'DEPLOYED_BRANCH=$CI_COMMIT_REF'
