PIPELINE EFFICIENCY FIX
Some checks failed
Build and Push Quarkus Image / build-and-push (push) Failing after 15m5s
Some checks failed
Build and Push Quarkus Image / build-and-push (push) Failing after 15m5s
This commit is contained in:
@@ -2,17 +2,15 @@ name: Build and Push Quarkus Image
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ "main" ] # Pas aan naar jouw hoofdbranch als dit 'master' is
|
branches: [ "main" ]
|
||||||
|
|
||||||
env:
|
env:
|
||||||
# VERVANG DIT door de domeinnaam van jouw Gitea server (zonder https://)
|
|
||||||
REGISTRY: git.melvanveen.nl
|
REGISTRY: git.melvanveen.nl
|
||||||
# Dit pakt automatisch de eigenaar en naam van de repo (bijv. username/quarkus-app)
|
|
||||||
IMAGE_NAME: ${{ github.repository }}
|
IMAGE_NAME: ${{ github.repository }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push:
|
build-and-push:
|
||||||
runs-on: ubuntu-latest # Zorg dat je Gitea runner Docker ondersteunt
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@@ -25,16 +23,30 @@ jobs:
|
|||||||
- name: Java 21 instellen
|
- name: Java 21 instellen
|
||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
java-version: '21' # Pas aan naar 17 als je Java 17 gebruikt
|
java-version: '21'
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
|
cache: 'maven'
|
||||||
|
|
||||||
|
- name: Versie bepalen en pom.xml updaten
|
||||||
|
run: |
|
||||||
|
NEW_VERSION="1.0.${{ github.run_number }}"
|
||||||
|
echo "APP_VERSION=$NEW_VERSION" >> $GITHUB_ENV
|
||||||
|
./mvnw versions:set -DnewVersion=$NEW_VERSION -DgenerateBackupPoms=false
|
||||||
|
|
||||||
|
- name: Cache SonarQube packages
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: ~/.sonar/cache
|
||||||
|
key: ${{ runner.os }}-sonar
|
||||||
|
restore-keys: ${{ runner.os }}-sonar
|
||||||
|
|
||||||
- name: SonarQube Analyse uitvoeren
|
- name: SonarQube Analyse uitvoeren
|
||||||
# Maven leest de configuratie uit pom.xml, we geven alleen het secret token mee via de command line
|
|
||||||
run: |
|
run: |
|
||||||
./mvnw clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \
|
./mvnw clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \
|
||||||
-Dsonar.token=${{ secrets.SONAR_TOKEN }}
|
-Dsonar.token=${{ secrets.SONAR_TOKEN }} \
|
||||||
|
-Dsonar.projectVersion=${{ env.APP_VERSION }}
|
||||||
|
|
||||||
- name: Quarkus applicatie bouwen (.jar genereren)
|
- name: Quarkus applicatie bouwen
|
||||||
run: ./mvnw clean package -DskipTests
|
run: ./mvnw clean package -DskipTests
|
||||||
|
|
||||||
- name: Inloggen op Gitea Container Registry
|
- name: Inloggen op Gitea Container Registry
|
||||||
@@ -42,17 +54,17 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
registry: ${{ env.REGISTRY }}
|
registry: ${{ env.REGISTRY }}
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
# Gitea genereert automatisch dit token, net als GitHub.
|
|
||||||
password: ${{ secrets.CR_PAT }}
|
password: ${{ secrets.CR_PAT }}
|
||||||
|
|
||||||
- name: Docker image bouwen en pushen
|
- name: Docker image bouwen en pushen
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
# We gebruiken de standaard JVM Dockerfile van Quarkus
|
|
||||||
file: src/main/docker/Dockerfile.jvm
|
file: src/main/docker/Dockerfile.jvm
|
||||||
push: true
|
push: true
|
||||||
# We taggen de image met 'latest' én met de specifieke commit-hash
|
|
||||||
tags: |
|
tags: |
|
||||||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
|
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
|
||||||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
|
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
|
||||||
|
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.APP_VERSION }}
|
||||||
|
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache
|
||||||
|
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache,mode=max
|
||||||
Reference in New Issue
Block a user