Wip/gitlab ci (#32)

Start CI/CD on a gitlab instance.
This commit is contained in:
Michael N. Lipp 2024-06-18 13:51:59 +02:00 committed by GitHub
parent 10182efea1
commit 7f80f4c6e9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 1676 additions and 1716 deletions

View file

@ -1,25 +1,69 @@
default:
# Template project: https://gitlab.com/pages/jekyll
# Docs: https://docs.gitlab.com/ee/pages/
image: ruby:3.2
stages:
- build
- test
- publish
- deploy
.any-job:
rules:
- if: $CI_SERVER_HOST == "gitlab.mnl.de"
.gradle-job:
extends: .any-job
image: registry.mnl.de/org/jgrapes/jdk21-builder:v2
cache:
- key: dependencies
policy: pull-push
paths:
- .gradle
- node_modules
- key: "$CI_COMMIT_SHA"
policy: pull-push
paths:
- build
- "*/build"
before_script:
- echo -n $CI_REGISTRY_PASSWORD | podman login -u "$CI_REGISTRY_USER" --password-stdin $CI_REGISTRY
- git switch $CI_COMMIT_REF_NAME
- git pull
- git reset --hard $CI_COMMIT_SHA
build-jars:
stage: build
extends: .gradle-job
script:
- ./gradlew -Pdocker.registry=$CI_REGISTRY_IMAGE build apidocs
publish-images:
stage: publish
extends: .gradle-job
script:
- ./gradlew -Pdocker.registry=$CI_REGISTRY_IMAGE pushImage
.pages-job:
extends: .any-job
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/ruby:3.2
variables:
JEKYLL_ENV: production
LC_ALL: C.UTF-8
before_script:
- git fetch origin gh-pages
- git checkout gh-pages
- gem install bundler
- bundle install
variables:
JEKYLL_ENV: production
LC_ALL: C.UTF-8
test:
test-pages:
stage: test
extends: .pages-job
script:
- bundle exec jekyll build -d test
artifacts:
paths:
- test
pages:
stage: deploy
publish-pages:
stage: publish
extends: .pages-job
script:
- bundle exec jekyll build -d public
artifacts: