From 26b0615b65fac19b2e3c76244f5f641a6aab2beb Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Sat, 26 Dec 2020 18:05:50 +0100 Subject: [PATCH] Add deploy step --- .gitlab-ci.yml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d120427..da568a8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -75,12 +75,16 @@ publish: only: - master -#deploy: -# tags: -# - it4nw -# stage: deploy -# image: tobedefined # todo: look for image with ssh -# script: -# - exit 1 -# only: -# - master +deploy: + stage: deploy + image: ubuntu + before_script: + - 'command -v ssh-agent >/dev/null || ( apt-get update -y && apt-get install openssh-client -y --no-install-recommends )' + - eval $(ssh-agent -s) + - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - + - mkdir -p ~/.ssh + - chmod 700 ~/.ssh + script: + - ssh blog -o StrictHostKeyChecking=no "/home/gaugendre/blog/update" + only: + - master