refactor: update Docker workflow and frontend configurations for consistency and optimization
Some checks failed
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
Some checks failed
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:
parent
c2d25f4a95
commit
f2e867867a
|
|
@ -6,22 +6,26 @@ on:
|
|||
branches: [ "main" ]
|
||||
paths:
|
||||
- 'backend/**'
|
||||
# - 'platform/**'
|
||||
- 'platform/**'
|
||||
- 'core/**'
|
||||
- 'frontend/**'
|
||||
- 'config/docker/**'
|
||||
# - 'build.gradle.kts'
|
||||
# - 'settings.gradle.kts'
|
||||
# - 'gradle.properties'
|
||||
# - 'build.gradle.kts'
|
||||
# - 'settings.gradle.kts'
|
||||
# - 'gradle.properties'
|
||||
- 'docker-compose.yaml'
|
||||
- '.gitea/workflows/docker-publish.yaml'
|
||||
|
||||
env:
|
||||
REGISTRY: git.mo-code.at
|
||||
# WICHTIG: Kleingeschrieben für Docker-Konformität
|
||||
IMAGE_PREFIX: mocode-software/meldestelle
|
||||
# Build Arguments für Zora (ARM64 Power)
|
||||
JAVA_VERSION: "25"
|
||||
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"
|
||||
|
||||
jobs:
|
||||
|
|
@ -47,17 +51,19 @@ jobs:
|
|||
context: .
|
||||
dockerfile: config/docker/keycloak/Dockerfile
|
||||
image: keycloak
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Java Setup (Wichtig für Gradle-Builds im Runner)
|
||||
- name: Set up JDK 25
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: ${{ env.JAVA_VERSION }}
|
||||
distribution: "temurin"
|
||||
cache: gradle
|
||||
|
||||
# Cache für Gradle (Beschleunigt Folgebauvorgänge massiv)
|
||||
- name: Setup Gradle Cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
|
|
@ -67,26 +73,25 @@ jobs:
|
|||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-gradle-
|
||||
|
||||
# Frontend Build (Nur für web-app notwendig)
|
||||
- name: Build Frontend (Kotlin JS)
|
||||
if: matrix.service == 'web-app'
|
||||
run: |
|
||||
chmod +x gradlew
|
||||
./gradlew :frontend:shells:meldestelle-portal:jsBrowserDistribution \
|
||||
-Pproduction=true \
|
||||
--max-workers=4 \
|
||||
--max-workers=8 \
|
||||
-Dkotlin.daemon.jvm.options="-Xmx4g"
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
# Login bei deiner Gitea Registry
|
||||
- name: Log in to the Container registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ secrets.REGISTRY_USER }}
|
||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||
|
||||
# Metadaten extrahieren (Tags, Labels)
|
||||
- name: Extract metadata
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
|
|
@ -95,7 +100,7 @@ jobs:
|
|||
tags: |
|
||||
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
|
||||
type=sha,format=long
|
||||
|
||||
# Build und Push (Nativ ARM64 für maximale Geschwindigkeit)
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
|
|
@ -104,7 +109,7 @@ jobs:
|
|||
push: true
|
||||
# Fokus auf ARM64 für Zora, AMD64 bleibt für Kompatibilität (optional)
|
||||
platforms: linux/arm64
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}/${{ matrix.name }}:latest
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
build-args: |
|
||||
DOCKER_BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
|
||||
|
|
@ -113,7 +118,3 @@ jobs:
|
|||
JAVA_VERSION=${{ env.JAVA_VERSION }}
|
||||
KEYCLOAK_IMAGE_TAG=26.4
|
||||
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
|
||||
js {
|
||||
browser {
|
||||
|
||||
commonWebpackConfig {
|
||||
cssSupport { enabled = true }
|
||||
// Webpack-Mode abhängig von Build-Typ
|
||||
mode = if (project.hasProperty("production"))
|
||||
KotlinWebpackConfig.Mode.PRODUCTION
|
||||
else
|
||||
|
|
@ -41,8 +41,10 @@ kotlin {
|
|||
// Das beschleunigt den Build massiv.
|
||||
if (mode == KotlinWebpackConfig.Mode.PRODUCTION && !project.hasProperty("enableSourceMaps")) {
|
||||
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']
|
||||
};
|
||||
|
||||
// 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
|
||||
config.module.noParse = config.module.noParse || [];
|
||||
if (Array.isArray(config.module.noParse)) {
|
||||
|
|
@ -160,4 +167,4 @@ if (config.optimization && config.optimization.minimizer) {
|
|||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user