From edfc8f49233dafa01145118ebb170b7c83b94f51 Mon Sep 17 00:00:00 2001 From: fzorb Date: Sat, 17 May 2025 09:34:42 +0300 Subject: [PATCH] Hoping this works :pray: --- .gitea/workflow.yaml | 52 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .gitea/workflow.yaml diff --git a/.gitea/workflow.yaml b/.gitea/workflow.yaml new file mode 100644 index 0000000..8052b6f --- /dev/null +++ b/.gitea/workflow.yaml @@ -0,0 +1,52 @@ +name: pipeline + +on: + push: + branches: + - main + +jobs: + deploy-job: + runs-on: docker + container: + image: ubuntu:latest + steps: + - name: init env + run: | + apt-get update + apt-get install -y rsync openssh-client git sshpass wget + cd /tmp + wget https://github.com/barnumbirr/zola-debian/releases/download/v0.20.0-1/zola_0.20.0-1_amd64_bookworm.deb + apt-get install -y ./zola_0.20.0-1_amd64_bookworm.deb + + - name: init git + run: | + git clone https://git.fzorb.xyz/fzorb/website + cd website + git submodule foreach --recursive git reset --hard + git submodule init + git submodule update --recursive + + - name: generate site + run: | + ls -a + cd website + ls -a + zola build + + - name: init ssh + run: | + mkdir ~/.ssh + ssh-keyscan -p 69 fzorb.xyz >> ~/.ssh/known_hosts + + - name: cleanup old files + run: | + sshsshpass -p '${{secrets.PASSWD}}' git@fzorb.xyz "rm -rf /var/www/fzorb.xyz/*" + + - name: upload new files + run: | + sshpass -p '${{secrets.PASSWD}}' rsync -avzh website/public/ -e 'ssh -p 69' git@fzorb.xyz:/var/www/fzorb.xyz + + - name: fix perms + run: | + sshpass -p '${{secrets.PASSWD}}' git@fzorb.xyz "chmod 777 -R /var/www/fzorb.xyz"