From 4280261c1e54c63e1702196c664023403d3424e6 Mon Sep 17 00:00:00 2001 From: Louis Vallat Date: Sat, 2 Jul 2022 01:16:39 +0200 Subject: [PATCH] feat: added CD deploy part to gitlab-ci.yml Signed-off-by: Louis Vallat --- .gitlab-ci.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2a96af4..85f15e3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -28,4 +28,15 @@ release-master: only: - master +deploy: + stage: deploy + before_script: + - eval $(ssh-agent -s) + - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - + - mkdir -p ~/.ssh + - chmod 700 ~/.ssh + script: + - ssh -o StrictHostKeyChecking=no -p $SSH_PORT $SSH_DESTINATION "cd $PATH_TO_APPLICATION; $UPGRADE_COMMAND;" + only: + - master