gcg-website/.gitlab-ci.yml

26 lines
843 B
YAML
Raw Normal View History

2022-03-20 12:25:50 +00:00
image: registry.gitlab.com/pages/hugo/hugo_extended:latest
variables:
GIT_SUBMODULE_STRATEGY: recursive
2022-03-20 16:37:31 +00:00
deploy_website:
2022-03-20 13:15:09 +00:00
before_script:
2022-03-20 16:37:31 +00:00
- apk add --update --no-cache git curl
- git config --global user.name "Denys Konovalov"
- git config --global user.email "denys.konovalov@protonmail.com"
2022-03-20 12:25:50 +00:00
script:
2022-03-20 16:37:31 +00:00
- hugo --gc --minify --cleanDestinationDir
- git clone --depth=1 --single-branch --branch main "https://x-access-token:$TOKEN@gitlab.cantorgymnasium.de/cantortechnik/website-build.git"
/tmp/gh-pages
2022-03-20 16:37:31 +00:00
- rm -rf /tmp/gh-pages/*
- export OLD_PATH=$PWD
2022-03-20 16:41:21 +00:00
- cp -r public/* /tmp/gh-pages
2022-03-20 16:37:31 +00:00
- cd /tmp/gh-pages
- git add .
- git commit -m "$CI_COMMIT_MESSAGE"
- git push -u origin main --force
- cd $OLD_PATH
- curl $host_url
2022-03-20 12:25:50 +00:00
artifacts:
paths:
- public
rules:
2022-04-14 11:51:49 +00:00
- if: "$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH"