- SSH is now done properly with host key checking

* Smoothed out some ci formatting
- Pulling out neocities deploy pipeline
This commit is contained in:
shockrah 2021-08-16 17:11:10 -07:00
parent 0e6935990f
commit 7ef53be386

View File

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