diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..accfb11 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,21 @@ +stages: + - deploy + +deploy-job: + stage: deploy + image: ubuntu:latest + before_script: + - apt-get update + - apt-get install -y rsync openssh-client hugo git sshpass + + script: + - git clone https://git.fzorb.xyz/fzorb/website + - cd website + - git submodule foreach --recursive git reset --hard && git submodule init && git submodule update --recursive + - hugo + - ssh-keyscan -p 69 fzorb.xyz >> ~/.ssh/known_hosts + - sshpass -p "$PASSWD" rsync -avzh website/public/ -e 'ssh -p 69' git@fzorb.xyz:/var/www/fzorb.xyz + - sshpass -p "$PASSWD" ssh -p 69 git@fzorb.xyz "chmod 777 -R /var/www/fzorb.xyz" + + only: + - main