From eb17b02b0441f962ec401599f16061c95740e605 Mon Sep 17 00:00:00 2001 From: fzorb Date: Thu, 5 Sep 2024 17:06:01 +0300 Subject: [PATCH] actions thingy --- action.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 action.yml diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..34ab80b --- /dev/null +++ b/action.yml @@ -0,0 +1,22 @@ +image: ubuntu:latest + +stages: + - deploy + +deploy: + stage: deploy + script: + - apt-get update + - apt-get install -y rsync openssh-client hugo git + - git submodule init + - git submodule update --recursive + - hugo + - mkdir -p ~/.ssh + - echo "$PRIVKEY" | base64 -d > ~/.ssh/id_rsa + - chmod 600 ~/.ssh/id_rsa + - ssh-keyscan -p 69 107.189.28.28 >> ~/.ssh/known_hosts + - ssh -i ~/.ssh/id_rsa -p 69 gitlab@107.189.28.28 "rm -rf /var/www/fzorb.xyz/*" + - rsync -avzh ./public/ -e "ssh -i ~/.ssh/id_rsa -p 69" gitlab@107.189.28.28:/var/www/fzorb.xyz + - ssh -i ~/.ssh/id_rsa -p 69 gitlab@107.189.28.28 "chmod 755 -R /var/www/fzorb.xyz" + only: + - main