refactor: update Docker workflow and frontend configurations for consistency and optimization
Build and Publish Docker Images / build-and-push (., backend/infrastructure/gateway/Dockerfile, gateway, api-gateway) (push) Failing after 53s
Build and Publish Docker Images / build-and-push (., backend/services/ping/Dockerfile, ping-service, ping-service) (push) Failing after 53s
Build and Publish Docker Images / build-and-push (., config/docker/caddy/web-app/Dockerfile, web-app, web-app) (push) Failing after 30m3s
Build and Publish Docker Images / build-and-push (., config/docker/keycloak/Dockerfile, keycloak, keycloak) (push) Failing after 53s
Build and Publish Docker Images / build-and-push (., backend/infrastructure/gateway/Dockerfile, gateway, api-gateway) (push) Failing after 53s
Build and Publish Docker Images / build-and-push (., backend/services/ping/Dockerfile, ping-service, ping-service) (push) Failing after 53s
Build and Publish Docker Images / build-and-push (., config/docker/caddy/web-app/Dockerfile, web-app, web-app) (push) Failing after 30m3s
Build and Publish Docker Images / build-and-push (., config/docker/keycloak/Dockerfile, keycloak, keycloak) (push) Failing after 53s
Streamlined `.gitea/workflows/docker-publish.yaml` by reordering Keycloak service, upgrading actions to latest versions, and improving build argument handling. Enhanced frontend build configurations by optimizing Webpack and disabling JS minification for SQLite to prevent Terser issues.
This commit is contained in:
@@ -6,22 +6,26 @@ on:
|
|||||||
branches: [ "main" ]
|
branches: [ "main" ]
|
||||||
paths:
|
paths:
|
||||||
- 'backend/**'
|
- 'backend/**'
|
||||||
# - 'platform/**'
|
- 'platform/**'
|
||||||
- 'core/**'
|
- 'core/**'
|
||||||
- 'frontend/**'
|
- 'frontend/**'
|
||||||
- 'config/docker/**'
|
- 'config/docker/**'
|
||||||
# - 'build.gradle.kts'
|
# - 'build.gradle.kts'
|
||||||
# - 'settings.gradle.kts'
|
# - 'settings.gradle.kts'
|
||||||
# - 'gradle.properties'
|
# - 'gradle.properties'
|
||||||
- 'docker-compose.yaml'
|
- 'docker-compose.yaml'
|
||||||
- '.gitea/workflows/docker-publish.yaml'
|
- '.gitea/workflows/docker-publish.yaml'
|
||||||
|
|
||||||
env:
|
env:
|
||||||
REGISTRY: git.mo-code.at
|
REGISTRY: git.mo-code.at
|
||||||
|
# WICHTIG: Kleingeschrieben für Docker-Konformität
|
||||||
IMAGE_PREFIX: mocode-software/meldestelle
|
IMAGE_PREFIX: mocode-software/meldestelle
|
||||||
|
# Build Arguments für Zora (ARM64 Power)
|
||||||
JAVA_VERSION: "25"
|
JAVA_VERSION: "25"
|
||||||
GRADLE_VERSION: "9.3.1"
|
GRADLE_VERSION: "9.3.1"
|
||||||
GRADLE_OPTS: "-Dorg.gradle.parallel=true -Dorg.gradle.workers.max=6"
|
# OPTIMIERUNG: Gradle Parameter für mehr Speed
|
||||||
|
GRADLE_OPTS: "-Dorg.gradle.parallel=true -Dorg.gradle.workers.max=8"
|
||||||
|
# Deine neuen JVM Power-Flags für ARM64 (Cortex-A720)
|
||||||
JVM_OPTS_ARM64: "-XX:ActiveProcessorCount=12 -XX:+UseG1GC -XX:+UseTransparentHugePages -XX:+UseSVE=1"
|
JVM_OPTS_ARM64: "-XX:ActiveProcessorCount=12 -XX:+UseG1GC -XX:+UseTransparentHugePages -XX:+UseSVE=1"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -47,17 +51,19 @@ jobs:
|
|||||||
context: .
|
context: .
|
||||||
dockerfile: config/docker/keycloak/Dockerfile
|
dockerfile: config/docker/keycloak/Dockerfile
|
||||||
image: keycloak
|
image: keycloak
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
# Java Setup (Wichtig für Gradle-Builds im Runner)
|
||||||
- name: Set up JDK 25
|
- name: Set up JDK 25
|
||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
java-version: ${{ env.JAVA_VERSION }}
|
java-version: ${{ env.JAVA_VERSION }}
|
||||||
distribution: "temurin"
|
distribution: "temurin"
|
||||||
cache: gradle
|
cache: gradle
|
||||||
|
# Cache für Gradle (Beschleunigt Folgebauvorgänge massiv)
|
||||||
- name: Setup Gradle Cache
|
- name: Setup Gradle Cache
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
@@ -67,26 +73,25 @@ jobs:
|
|||||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-gradle-
|
${{ runner.os }}-gradle-
|
||||||
|
# Frontend Build (Nur für web-app notwendig)
|
||||||
- name: Build Frontend (Kotlin JS)
|
- name: Build Frontend (Kotlin JS)
|
||||||
if: matrix.service == 'web-app'
|
if: matrix.service == 'web-app'
|
||||||
run: |
|
run: |
|
||||||
chmod +x gradlew
|
chmod +x gradlew
|
||||||
./gradlew :frontend:shells:meldestelle-portal:jsBrowserDistribution \
|
./gradlew :frontend:shells:meldestelle-portal:jsBrowserDistribution \
|
||||||
-Pproduction=true \
|
-Pproduction=true \
|
||||||
--max-workers=4 \
|
--max-workers=8 \
|
||||||
-Dkotlin.daemon.jvm.options="-Xmx4g"
|
-Dkotlin.daemon.jvm.options="-Xmx4g"
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
# Login bei deiner Gitea Registry
|
||||||
- name: Log in to the Container registry
|
- name: Log in to the Container registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ${{ env.REGISTRY }}
|
registry: ${{ env.REGISTRY }}
|
||||||
username: ${{ secrets.REGISTRY_USER }}
|
username: ${{ secrets.REGISTRY_USER }}
|
||||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
|
# Metadaten extrahieren (Tags, Labels)
|
||||||
- name: Extract metadata
|
- name: Extract metadata
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v5
|
||||||
@@ -95,7 +100,7 @@ jobs:
|
|||||||
tags: |
|
tags: |
|
||||||
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
|
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
|
||||||
type=sha,format=long
|
type=sha,format=long
|
||||||
|
# Build und Push (Nativ ARM64 für maximale Geschwindigkeit)
|
||||||
- name: Build and push Docker image
|
- name: Build and push Docker image
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
@@ -104,7 +109,7 @@ jobs:
|
|||||||
push: true
|
push: true
|
||||||
# Fokus auf ARM64 für Zora, AMD64 bleibt für Kompatibilität (optional)
|
# Fokus auf ARM64 für Zora, AMD64 bleibt für Kompatibilität (optional)
|
||||||
platforms: linux/arm64
|
platforms: linux/arm64
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}/${{ matrix.name }}:latest
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
build-args: |
|
build-args: |
|
||||||
DOCKER_BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
|
DOCKER_BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
|
||||||
@@ -113,7 +118,3 @@ jobs:
|
|||||||
JAVA_VERSION=${{ env.JAVA_VERSION }}
|
JAVA_VERSION=${{ env.JAVA_VERSION }}
|
||||||
KEYCLOAK_IMAGE_TAG=26.4
|
KEYCLOAK_IMAGE_TAG=26.4
|
||||||
JVM_OPTS_APPEND=${{ env.JVM_OPTS_ARM64 }}
|
JVM_OPTS_APPEND=${{ env.JVM_OPTS_ARM64 }}
|
||||||
# cache-from: type=local,src=/tmp/.buildx-cache
|
|
||||||
# cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
|
|
||||||
# cache-from: type=gha
|
|
||||||
# cache-to: type=gha,mode=max
|
|
||||||
|
|||||||
@@ -29,9 +29,9 @@ kotlin {
|
|||||||
// JavaScript Target für Web
|
// JavaScript Target für Web
|
||||||
js {
|
js {
|
||||||
browser {
|
browser {
|
||||||
|
|
||||||
commonWebpackConfig {
|
commonWebpackConfig {
|
||||||
cssSupport { enabled = true }
|
cssSupport { enabled = true }
|
||||||
// Webpack-Mode abhängig von Build-Typ
|
|
||||||
mode = if (project.hasProperty("production"))
|
mode = if (project.hasProperty("production"))
|
||||||
KotlinWebpackConfig.Mode.PRODUCTION
|
KotlinWebpackConfig.Mode.PRODUCTION
|
||||||
else
|
else
|
||||||
@@ -41,8 +41,10 @@ kotlin {
|
|||||||
// Das beschleunigt den Build massiv.
|
// Das beschleunigt den Build massiv.
|
||||||
if (mode == KotlinWebpackConfig.Mode.PRODUCTION && !project.hasProperty("enableSourceMaps")) {
|
if (mode == KotlinWebpackConfig.Mode.PRODUCTION && !project.hasProperty("enableSourceMaps")) {
|
||||||
sourceMaps = false
|
sourceMaps = false
|
||||||
} else if (project.hasProperty("noSourceMaps")) {
|
}
|
||||||
sourceMaps = false
|
|
||||||
|
if (mode == KotlinWebpackConfig.Mode.PRODUCTION && !project.hasProperty("enableSourceMaps")) {
|
||||||
|
sourceMaps = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -137,7 +137,14 @@ config.devServer.devMiddleware.mimeTypes = {
|
|||||||
'application/javascript': ['js']
|
'application/javascript': ['js']
|
||||||
};
|
};
|
||||||
|
|
||||||
// 10. OPTIMIZATION: Exclude SQLite workers from parsing and minification
|
// 10. OPTIMIZATION: Disable minification to prevent Terser crashes with SQLite WASM
|
||||||
|
// Since the app is mostly WASM-based, JS minification is not critical.
|
||||||
|
if (config.optimization) {
|
||||||
|
console.log("SQLite Config: Disabling minification to prevent Terser errors.");
|
||||||
|
config.optimization.minimize = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*// 10. OPTIMIZATION: Exclude SQLite workers from parsing and minification
|
||||||
// This fixes the "return outside of function" error in Terser and speeds up build
|
// This fixes the "return outside of function" error in Terser and speeds up build
|
||||||
config.module.noParse = config.module.noParse || [];
|
config.module.noParse = config.module.noParse || [];
|
||||||
if (Array.isArray(config.module.noParse)) {
|
if (Array.isArray(config.module.noParse)) {
|
||||||
@@ -160,4 +167,4 @@ if (config.optimization && config.optimization.minimizer) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}*/
|
||||||
|
|||||||
Reference in New Issue
Block a user