Add deploy step

This commit is contained in:
Gabriel Augendre 2020-12-26 18:05:50 +01:00
parent 30c5b3fc1f
commit 26b0615b65
No known key found for this signature in database
GPG key ID: 1E693F4CE4AEE7B4

View file

@ -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