From 2a8f9210273e10a629bbd2298be130ef1dd61214 Mon Sep 17 00:00:00 2001 From: yova Date: Wed, 22 Sep 2021 23:47:45 +0200 Subject: [PATCH] initial pipe --- .gitlab-ci.yml | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..fc56e3d --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,39 @@ +stages: + - build + - deploy + +variables: + NAME: "yova" + EMAIL: "tech@freedomhost.de" + GIT_SUBMODULE_STRATEGY: recursive + HUGO_DOMAIN: wntr.org + HUGO_BASEURL: https://$HUGO_DOMAIN/ + +build: + image: xdevbase/hugo-builder + stage: build + only: + - master + script: + - hugo + artifacts: + paths: + - public/ + +deploy: + image: alpine + stage: deploy + environment: + name: development + url: $HUGO_BASEURL + only: + - master + before_script: + - apk add --no-cache git openssh + - mkdir -p ~/.ssh + - echo "$SSH_PRIVATE_KEY" >> ~/.ssh/id_rsa + - chmod 600 ~/.ssh/id_rsa + - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config + script: + - cd public + - rsync -rz -e 'ssh -p 1006' . gh0st@135.125.132.92:/var/www/$HUGO_DOMAIN