From d416f39b36c5d1f4643db164ef93e3de20f2cfea Mon Sep 17 00:00:00 2001 From: Ske Date: Tue, 16 Jul 2019 12:34:10 +0200 Subject: [PATCH] Add .gitlab-ci.yml --- .gitlab-ci.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 00000000..2e9d0021 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,17 @@ +deploy: + image: alpine:3.10 + stage: deploy + environment: + name: production + url: pluralkit.me + before_script: + # Based on https://gitlab.com/gitlab-examples/ssh-private-key/issues/4#note_35042568 + - apk add --no-cache openssh-client + - mkdir -p ~/.ssh + - eval $(ssh-agent -s) + - echo "$SSH_PRIVATE_KEY" | ssh-add - + - ssh-keyscan -H $PROD_IP >> ~/.ssh/known_hosts + only: + - master + script: + - ssh $PROD_USER@$PROD_IP "cd PluralKit && git pull && docker-compose build && docker-compose up -d" \ No newline at end of file