From 2fd803e0eafbe49f8cb8df88d0387d7cea610a6b Mon Sep 17 00:00:00 2001 From: Drew Short Date: Tue, 29 Jan 2019 21:10:25 -0600 Subject: [PATCH] Attempting to get autodeploy working --- .gitlab-ci.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1c9a2c5..2176745 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -18,3 +18,21 @@ build-resume: - resume_for_recruiters.pdf - ResumeSite.tar.gz +deploy-resume: + image: sothr.com/deploy:stretch + stage: deploy + variables: + TARGET_DIRECTORY: "/srv/www/sothr.com/resume" + script: + - eval `ssh-agent -s` + - ssh-add <(echo "$SSH_DEPLOY_KEY") + - mkdir /tmp/deploy + - tar -xvf ResumeSite.tar.gz /tmp/deploy + - cp resume.pdf /tmp/deploy + - cp resume_for_recruiters.pdf /tmp/deploy + - rsync -avz --delete-delay -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress /tmp/deploy/* $DEPLOY_USER@$DEPLOY_HOST:$TARGET_DIRECTORY + only: + - master + tags: + - docker + environment: production \ No newline at end of file