From 1101beac23428a22d4736efae69505db59a46cc6 Mon Sep 17 00:00:00 2001 From: shockrah Date: Mon, 8 Feb 2021 19:22:48 -0800 Subject: [PATCH] adding auto deploy for neocities --- .gitlab-ci.yml | 39 ++++++++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8d4577c..c31d705 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,12 @@ -image: shockrah/website:1.2 +image: shockrah/website:1.3 + +stages: + - build + - deploy + +variables: + SHOPTS: "-o StrictHostKeyChecking=no" + before_script: - eval $(ssh-agent -s) @@ -6,9 +14,30 @@ before_script: - mkdir -p ~/.ssh/ - chmod 700 ~/.ssh/ -deploy: +build-site: stage: build script: - - bash ./build.sh - - ssh -o StrictHostKeyChecking=no root@shockrah.xyz "rm -rf /var/www/website" - - scp -o StrictHostKeyChecking=no -r .mirror root@shockrah.xyz:/var/www/website/ + bash ./build.sh + +deploy-vps: + stage: deploy + + script: + - ssh $SHOPTS root@shockrah.xyz "rm -rf /var/www/website" + - scp $SHOPTS -r .mirror root@shockrah.xyz:/var/www/website/ + +deploy-neocities: + stage: deploy + + script: + # First the html + - bash upload.sh -h + # then we do the media files + - > for file in $(find media);do + if [ -f $file ];then + bash upload.sh -m $file + fi + done + + +