Skip to content

Merge pull request #83 from SecretJ12/refactor/adjust-properties #39

Merge pull request #83 from SecretJ12/refactor/adjust-properties

Merge pull request #83 from SecretJ12/refactor/adjust-properties #39

Workflow file for this run

name: Build and Push Docker Image
on:
push:
tags:
- 'v*.*.*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
ghcr.io/${{ github.repository }}
# generate Docker tags based on the following events/attributes
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GH_PAT }}
- name: Set up JDK 22
uses: actions/setup-java@v4
with:
java-version: '22'
distribution: 'temurin'
cache: maven
- name: Set versions
run: |
TAG_VERSION=${{ github.ref }}
VERSION=${TAG_VERSION#refs/tags/v}
mvn versions:set -DnewVersion=$VERSION
mvn versions:commit
jq --arg version "$VERSION" '.version= $version' src/main/webui/package.json > tmp.$$.json && mv tmp.$$.json src/main/webui/package.json
- name: Build with Maven
run: mvn package
- name: Build and push
uses: docker/build-push-action@v6
with:
file: ./src/main/docker/Dockerfile.jvm
context: .
cache-from: |
user/app:cache
type=local,src=.
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}