All checks were successful
Build and Push Quarkus Image / build-and-push (push) Successful in 6m54s
68 lines
1.9 KiB
YAML
68 lines
1.9 KiB
YAML
name: Build and Push Quarkus Image
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main" ]
|
|
|
|
env:
|
|
REGISTRY: git.melvanveen.nl
|
|
IMAGE_NAME: ${{ github.repository }}
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
steps:
|
|
- name: Code ophalen
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Java 21 instellen
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
java-version: '21'
|
|
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
|
|
run: |
|
|
./mvnw clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \
|
|
-Dsonar.token=${{ secrets.SONAR_TOKEN }} \
|
|
-Dsonar.projectVersion=${{ env.APP_VERSION }}
|
|
|
|
- name: Quarkus applicatie bouwen
|
|
run: ./mvnw clean package -DskipTests
|
|
|
|
- name: Inloggen op Gitea Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.CR_PAT }}
|
|
|
|
- name: Docker image bouwen en pushen
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
file: src/main/docker/Dockerfile.jvm
|
|
push: true
|
|
tags: |
|
|
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
|
|
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
|
|
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.APP_VERSION }} |