2023-11-04 20:43:29 +01:00
|
|
|
variables:
|
|
|
|
TZ: Europe/Berlin
|
|
|
|
|
2023-10-25 02:07:53 +02:00
|
|
|
stages:
|
|
|
|
- build
|
|
|
|
- deploy
|
|
|
|
|
|
|
|
build-website:
|
|
|
|
stage: build
|
2023-11-30 23:27:55 +01:00
|
|
|
image: registry.gitlab.com/pages/hugo/hugo_extended:latest
|
2023-10-25 02:07:53 +02:00
|
|
|
before_script:
|
|
|
|
- apk update
|
2023-11-30 23:27:55 +01:00
|
|
|
- apk add tzdata coreutils curl jq git
|
2023-10-25 02:07:53 +02:00
|
|
|
script:
|
|
|
|
- ./fetch-calendar.sh
|
|
|
|
- sed -i "s#baseURL = 'https://hamburg.ccc.de/'#baseURL = 'https://next.hamburg.ccc.de/'#" hugo.toml
|
|
|
|
- hugo
|
|
|
|
artifacts:
|
2023-11-04 00:49:18 +01:00
|
|
|
untracked: true
|
2023-10-25 02:07:53 +02:00
|
|
|
expose_as: "website build"
|
|
|
|
name: "website-build-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA"
|
|
|
|
paths:
|
|
|
|
- public/
|
2023-12-09 18:08:01 +01:00
|
|
|
expire_in: 1 day
|
2023-10-25 02:07:53 +02:00
|
|
|
|
|
|
|
deploy-website:
|
|
|
|
stage: deploy
|
|
|
|
image: alpine
|
|
|
|
before_script:
|
|
|
|
- apk update
|
|
|
|
- apk add rsync openssh
|
|
|
|
script:
|
|
|
|
- chmod 400 $NEXT_SSH_DEPLOY_KEY
|
|
|
|
- rsync -r --delete -e "ssh -i $NEXT_SSH_DEPLOY_KEY -o 'UserKnownHostsFile $SSH_KNOWN_HOSTS_FILE'" public/ ccchh-website-deploy@public-web-static-intern.hamburg.ccc.de:/var/www/next.hamburg.ccc.de/
|
|
|
|
rules:
|
|
|
|
- if: $CI_COMMIT_BRANCH == "main"
|
|
|
|
when: on_success
|
|
|
|
- when: never
|