From 37cbb435c51095a7adc29b4a55b9e8989e63ca56 Mon Sep 17 00:00:00 2001 From: Denys Konovalov Date: Sun, 20 Mar 2022 16:37:31 +0000 Subject: [PATCH] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 11927ccd..5ef51e5f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,12 +5,23 @@ variables: -pages: +deploy_website: before_script: - - apk add --update --no-cache openssh sshpass + - apk add --update --no-cache git curl + - git config --global user.name "Denys Konovalov" + - git config --global user.email "denys.konovalov@protonmail.com" script: - - hugo - - sshpass -p $scp_password scp -oStrictHostKeyChecking=no -r public $scp_path + - hugo --gc --minify --cleanDestinationDir + - git clone --depth=1 --single-branch --branch "${INPUT_BRANCH}" "https://x-access-token:$TOKEN@gitlab.cantorgymnasium.de/cantortechnik/website-build.git" /tmp/gh-pages + - rm -rf /tmp/gh-pages/* + - export OLD_PATH=$PWD + - cp public/* /tmp/gh-pages + - cd /tmp/gh-pages + - git add . + - git commit -m "$CI_COMMIT_MESSAGE" + - git push -u origin main --force + - cd $OLD_PATH + - curl $host_url artifacts: paths: - public