Deploy to server via SSH

This commit is contained in:
Joey Hafner 2022-02-10 17:25:26 +00:00
parent 87b8427c84
commit 0fc845bfc5

View File

@ -1,9 +1,18 @@
stages: before_script:
- deploy # 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: server-deploy:
stage: deploy stage: deploy
only: only:
- "server/" - "server/"
script: script:
- echo "I want to SSH to server" - ssh joey@joey-server "cd /home/joey/docker_config && git pull origin master && exit"