diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..ddbc57f --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,13 @@ +deploy-prod: + stage: deploy + image: alpine + before_script: + - 'command -v ssh-agent > /dev/null || (apk add --update openssh-client)' + - eval $(ssh-agent -s) + - echo "$GITLAB_LIVILLA_PRIV" | tr -d '\r' | ssh-add - + - mkdir -p ~/.ssh + - chmod 700 ~/.ssh + - ssh-keyscan $LIVILLA_IP >> ~/.ssh/known_hosts + - chmod 644 ~/.ssh/known_hosts + script: + - ssh $LIVILLA_USER@$LIVILLA_IP 'cd phaetere/blog_posts;git pull'