From a8406c9bb41675b68861c8899c7502d6afcfacdd Mon Sep 17 00:00:00 2001 From: Remo Liebmann Date: Mon, 16 Feb 2026 16:03:50 +0100 Subject: [PATCH] adjust to new workflow --- .gitlab-ci.yml | 51 +++++++++++++++++++---- Dockerfile | 4 +- config/development/hugo.toml | 34 +++++++++++++++ config/{_default => production}/hugo.toml | 2 +- 4 files changed, 80 insertions(+), 11 deletions(-) create mode 100644 config/development/hugo.toml rename config/{_default => production}/hugo.toml (97%) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 05c5c9e..589695c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,25 +3,58 @@ stages: - deploy variables: - DOCKER_TLS_CERTDIR: "/certs" + DOCKER_TLS_CERTDIR: "/certs" -build: +.build_template: &build_template image: docker:24.0.5 stage: build - only: - - main services: - docker:24.0.5-dind script: - echo "$CI_REGISTRY_PASSWORD" | docker login registry.remo-liebmann.de -u reguser --password-stdin - - docker build -t registry.remo-liebmann.de/hallofbrawl-homepage:latest . - - docker push registry.remo-liebmann.de/hallofbrawl-homepage:latest + - docker build --build-arg HUGO_ENV=$HUGO_ENV -t registry.remo-liebmann.de/hallofbrawl-homepage:$IMAGE_TAG . + - docker push registry.remo-liebmann.de/hallofbrawl-homepage:$IMAGE_TAG -deploy: +.deploy_template: &deploy_template image: alpine/curl stage: deploy + script: + - curl --insecure -X POST $PORTAINER_WEBHOOK + +# ------------------------- +# PRODUCTION (main) +# ------------------------- + +build_prod: + <<: *build_template only: - main - script: - - curl --insecure -I -X POST https://192.168.12.21:9443/api/webhooks/ee5dbc0d-18e8-45d7-bcfd-b24d1f2c0ee6 + variables: + IMAGE_TAG: prod + HUGO_ENV: production +deploy_prod: + <<: *deploy_template + only: + - main + variables: + PORTAINER_WEBHOOK: "https://192.168.12.21:9443/api/webhooks/ee5dbc0d-18e8-45d7-bcfd-b24d1f2c0ee6" + +# ------------------------- +# DEVELOPMENT (development) +# ------------------------- + +build_dev: + <<: *build_template + only: + - development + variables: + IMAGE_TAG: dev + HUGO_ENV: development + +deploy_dev: + <<: *deploy_template + only: + - development + variables: + PORTAINER_WEBHOOK: "https://192.168.12.21:9443/api/webhooks/DEV-WEBHOOK-ID" \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index fede03a..f076304 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,9 @@ FROM docker.io/hugomods/hugo:latest AS build WORKDIR /src COPY . . RUN git submodule update --init --recursive --progress -RUN hugo +ARG HUGO_ENV=production +ENV HUGO_ENV=${HUGO_ENV} +RUN hugo --environment $HUGO_ENV --minify FROM nginx:alpine COPY --from=build /src/public /usr/share/nginx/html \ No newline at end of file diff --git a/config/development/hugo.toml b/config/development/hugo.toml new file mode 100644 index 0000000..17c7e8e --- /dev/null +++ b/config/development/hugo.toml @@ -0,0 +1,34 @@ +theme = "blowfish" +defaultContentLanguage = "de" +enableRobotsTXT = true +summaryLength = 50 +buildDrafts = false +buildFuture = true +enableEmoji = true +baseURL = "https://dev.hallofbrawl.de" +googleAnalytics = "" + +[pagination] +pagerSize = 100 + +[imaging] +anchor = "Center" + +[taxonomies] +tag = "tags" +category = "categories" +author = "authors" +series = "series" + +[sitemap] +changefreq = "daily" +filename = "sitemap.xml" +priority = 0.5 + +[outputs] +home = [ "HTML", "RSS", "JSON" ] + +[related] +threshold = 0 +toLower = false +indices = [ { name = "tags", weight = 100 }, { name = "categories", weight = 100 }, { name = "series", weight = 50 }, { name = "authors", weight = 20 }, { name = "date", weight = 10 }, { applyFilter = false, name = "fragmentrefs", type = "fragments", weight = 10 } ] diff --git a/config/_default/hugo.toml b/config/production/hugo.toml similarity index 97% rename from config/_default/hugo.toml rename to config/production/hugo.toml index a3f81bf..cb99c9a 100644 --- a/config/_default/hugo.toml +++ b/config/production/hugo.toml @@ -3,7 +3,7 @@ defaultContentLanguage = "de" enableRobotsTXT = true summaryLength = 50 buildDrafts = false -buildFuture = false +buildFuture = true enableEmoji = true baseURL = "https://www.hallofbrawl.de" googleAnalytics = ""