image: alpine:3.18

pipelines:
  branches:
    master:
      - step:
          name: Deploy to Staging
          deployment: staging
          caches:
            - node
          script:
            - apk add --no-cache openssh-client rsync sshpass
            - sshpass -p ${SSH_PASS} rsync -avz --delete -e "ssh -o StrictHostKeyChecking=no" --exclude '.git' --exclude 'node_modules' ./ ${SSH_USER}@${SSH_HOST}:/home/${SSH_USER}/public_html/
            - sshpass -p ${SSH_PASS} ssh -o StrictHostKeyChecking=no ${SSH_USER}@${SSH_HOST} "cd /home/${SSH_USER}/public_html/ && npm i --no-audit --progress=false && gulp deploy"
