diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 716af77..e0e7ba5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,13 +2,13 @@ image: registry.gitlab.com/pages/hugo:latest stages: - build - - vps + - deploy variables: GIT_SUBMODULE_STRATEGY: recursive -# Only because it's broken right now +# This build stage will also leave artifacts ready for gitlab pages to use build: stage: build only: @@ -19,6 +19,25 @@ build: artifacts: paths: - public - only: - - master +# Here we deploy the site +deploy-to-athens: + stage: deploy + image: shockrah/website:latest + only: + refs: + - master + needs: + - build + dependencies: + - build + before_script: + - eval $(ssh-agent -s) + - echo "${WEB_USR_KEY}" | ssh-add - > /dev/null + - mkdir -p ~/.ssh/ + - chmod 700 ~/.ssh/ + - ssh-keyscan shockrah.xyz 2>&1 >> ~/.ssh/known_hosts + - chmod 644 ~/.ssh/known_hosts + script: + - ssh web@shockrah.xyz "rm -rf /var/www/resume.shockrah.xyz" + - scp -r public/ web@shockrah.xyz:/var/www/resume.shockrah.xyz