Add ssh deploy config

This commit is contained in:
2019-02-07 17:39:03 +01:00
parent ba68f6e22f
commit 78e067d001
+11 -1
View File
@@ -3,9 +3,19 @@ image: monachus/hugo
variables: variables:
GIT_SUBMODULE_STRATEGY: recursive GIT_SUBMODULE_STRATEGY: recursive
pages: before_script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client rsync -y )'
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
deploy:
script: script:
- hugo - hugo
- rsync -av --delete --exclude presentations public/ james@shee.sh:/srv/www/jamesmcdonald
artifacts: artifacts:
paths: paths:
- public - public