gcg-website/.gitlab-ci.yml

29 lines
851 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 13:15:09 +00:00
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 "${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
2022-03-20 12:25:50 +00:00
artifacts:
paths:
- public
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH