diff --git a/.drone.yml b/.drone.yml index a72e404..c125818 100644 --- a/.drone.yml +++ b/.drone.yml @@ -27,4 +27,4 @@ steps: # skip key checking - echo "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config - cat ~/.ssh/config - - ssh gemini@period3.xyz "git clone $REPO" + - ssh gemini@period3.xyz "chmod +x deploy.sh && bash deploy.sh $REPO" diff --git a/deploy.sh b/deploy.sh index cfa980b..d50fc41 100644 --- a/deploy.sh +++ b/deploy.sh @@ -1,20 +1,8 @@ #!/usr/bin/env bash -site=period3.xyz -gemini=/home/gemini/gemini -dest="$gemini/content" - -# remove existing files -sudo rm -rv $dest - -# copy received files to hosting location -sudo mv $site $dest -sudo chown -R gemini:gemini $dest - -# delete self -rm -v deploy.sh - -printf "\ndone!\n" - - +repo="$1" +deploypath="$HOME/gemini/content" +sourcepath="content" +[[ -d $deploypath ]] && rm -r $deploypath +cp -r $sourcepath $deploypath