Skip to content

v0.5.0

v0.5.0 #55

Workflow file for this run

# GitHub Actions Workflow created for handling the release process based on the draft release prepared
# with the Draft Release workflow.
name: Release Docker Image
on:
release:
types: [prereleased, released]
jobs:
releaseDockerImage:
name: Release Docker Image
runs-on: ubuntu-latest
steps:
- name: Fetch Sources
uses: actions/checkout@v4
- name: Setup Environment
run: |
VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "MVN_OPTS=-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true --batch-mode --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true" >> $GITHUB_ENV
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: corretto
java-version: 17
# Create the docker image
- name: Build & Push Docker Image
if: success()
env:
IMAGE_NAME: ${{ github.repository }}
IMAGE_VERSION: ${{ env.VERSION }}
REGISTRY_PASS: ${{ secrets.GITHUB_TOKEN }}
REGISTRY_USER: ${{ github.actor }}
REGISTRY_NAME: ghcr.io
run: |
set -x
echo $REGISTRY_PASS | docker login "${REGISTRY_NAME}" -u "${REGISTRY_PASS}" --password-stdin
# Changing the default driver is mandatory for multi-arch builds
docker buildx create --name multiarch --use
./mvnw package -Pdocker -DdockerImageTag=latest -DdockerImageAdditionalTags="${IMAGE_VERSION}" -DdockerImageArchs=linux/amd64,linux/arm64 -DdockerBuildOutput=type=image \
-DdockerImagePush=true -DdockerRegistry="${REGISTRY_NAME}" -DdockerPassword="${REGISTRY_PASS}" -DdockerUsername="${REGISTRY_USER}" $MVN_OPTS