From 7ef53be386467576a92fcba6baec0939c1cdfc54 Mon Sep 17 00:00:00 2001 From: shockrah Date: Mon, 16 Aug 2021 17:11:10 -0700 Subject: [PATCH] - SSH is now done properly with host key checking * Smoothed out some ci formatting - Pulling out neocities deploy pipeline --- .gitlab-ci.yml | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) 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