diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8d8ae63..9b1907e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,16 +4,17 @@ stages: - build - deploy -variables: - SHOPTS: "-o StrictHostKeyChecking=no" - - +# Setup the SSH Key in required for VPS deployment first before_script: - - eval $(ssh-agent -s) + - eval "$(ssh-agent -s)" - echo "${SSH_PRIVATE_KEY}" | ssh-add - > /dev/null + - mkdir -p ~/.ssh/ - chmod 700 ~/.ssh/ + - ssh-keyscan $VPS_HOST 2>&1 >> ~/.ssh/known_hosts + - chmod 644 ~/.ssh/known_hosts + build-site: only: refs: @@ -22,11 +23,12 @@ build-site: stage: build script: - bash ./build.sh + - hugo artifacts: expire_in: 10 mins - paths: ["./.mirror"] + paths: + - "public" deploy-vps: only: @@ -35,14 +37,16 @@ deploy-vps: stage: deploy + # This is all fine because its just static html w/ no scripts :^) script: - - ssh $SHOPTS root@shockrah.xyz "rm -rf /var/www/website" - - scp $SHOPTS -r .mirror root@shockrah.xyz:/var/www/website/ + - ssh root@shockrah.xyz "rm -rf /var/www/website" + - scp -r public/ root@shockrah.xyz:/var/www/website/ deploy-neocities: + # This might get really ugly with neocities so hang on only: refs: - - master + - neocities stage: deploy