diff --git a/homelab/.gitlab-ci.yml b/homelab/.gitlab-ci.yml index dfefb032..72676c01 100644 --- a/homelab/.gitlab-ci.yml +++ b/homelab/.gitlab-ci.yml @@ -1,9 +1,18 @@ -stages: - - deploy +before_script: + # update and install git + - apt-get update -qq + - apt-get install -qq git + # configure SSH keys + - 'which ssh-agent || ( apt-get install -qq openssh-client )' + - eval $(ssh-agent -s) + - ssh-add <(echo "$SSH_PRIVATE_KEY") + - mkdir -p ~/.ssh + - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrickHostKeyChecking no\n\n" > ~/.ssh/config' + server-deploy: stage: deploy only: - "server/" script: - - echo "I want to SSH to server" + - ssh joey@joey-server "cd /home/joey/docker_config && git pull origin master && exit"