homelab/.gitlab-ci.yml
2022-02-25 21:30:41 +00:00

24 lines
564 B
YAML

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\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
server-deploy:
stage: deploy
when: always
rules:
- changes:
- server/
when: manual
script:
- ssh joey@joey-server "cd /home/joey/homelab && git pull"