name: Build and Publish Docker Images on: push: branches: [ "main" ] paths: - 'backend/**' - 'core/**' - 'frontend/**' - 'config/docker/**' - 'docker-compose.yaml' - '.gitea/workflows/docker-publish.yaml' jobs: # JOB 1: Backend Services (api-gateway, ping-service, keycloak) build-backend: runs-on: ubuntu-latest strategy: fail-fast: false matrix: include: - service: api-gateway dockerfile: backend/infrastructure/gateway/Dockerfile - service: ping-service dockerfile: backend/services/ping/Dockerfile - service: keycloak dockerfile: config/docker/keycloak/Dockerfile steps: - name: Checkout repository uses: actions/checkout@v4 - name: Set up JDK 25 uses: actions/setup-java@v4 with: java-version: '25' distribution: 'temurin' - name: Set up Docker Buildx uses: actions/setup-buildx-action@v3 - name: Log in to Registry uses: docker/login-action@v3 with: registry: git.mo-code.at username: ${{ secrets.REGISTRY_USER }} password: ${{ secrets.REGISTRY_TOKEN }} - name: Build and push image uses: docker/build-push-action@v5 with: context: . file: ${{ matrix.dockerfile }} push: true tags: git.mo-code.at/mocode-software/meldestelle/${{ matrix.service }}:latest build-args: | GRADLE_VERSION=9.3.1 JAVA_VERSION=25 JVM_OPTS_APPEND=-XX:ActiveProcessorCount=8 -XX:+UseG1GC -XX:+UseSVE=1 # JOB 2: Frontend (Separater Job für maximale RAM-Verfügbarkeit) build-frontend: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 - name: Set up JDK 25 uses: actions/setup-java@v4 with: java-version: '25' distribution: 'temurin' - name: Build JS Frontend Artifacts run: | chmod +x gradlew ./gradlew :frontend:shells:meldestelle-portal:jsBrowserDistribution \ -Pproduction=true \ --max-workers=4 \ --no-daemon \ -Dkotlin.daemon.jvm.options="-Xmx4g" - name: Set up Docker Buildx uses: actions/setup-buildx-action@v3 - name: Log in to Registry uses: docker/login-action@v3 with: registry: git.mo-code.at username: ${{ secrets.REGISTRY_USER }} password: ${{ secrets.REGISTRY_TOKEN }} - name: Build and push Web-App Image uses: docker/build-push-action@v5 with: context: . file: config/docker/caddy/web-app/Dockerfile push: true tags: git.mo-code.at/mocode-software/meldestelle/web-app:latest