switch to OpenJ9 JRE in Dockerfile #617
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Java CI | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: read | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: maven | |
- name: Build with Maven | |
run: mvn --batch-mode --update-snapshots clean install --activate-profiles ui | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- run: mkdir staging && cp music-client-ui/target/*.jar staging | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: Package | |
path: staging | |
# From https://stackoverflow.com/a/65740844 | |
- name: Extract Maven project version | |
run: echo ::set-output name=version::$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec) | |
id: project | |
- name: Show extracted Maven project version | |
run: echo ${{ steps.project.outputs.version }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
with: | |
image: tonistiigi/binfmt:latest | |
platforms: arm64,arm | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to DockerHub | |
if: ${{ github.ref == 'refs/heads/master' }} | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build image and push to Docker Hub | |
uses: docker/build-push-action@v6 | |
with: | |
platforms: linux/arm64,linux/amd64 | |
context: . | |
tags: | | |
stevenmassaro/music-client:latest | |
stevenmassaro/music-client:${{ steps.project.outputs.version }} | |
# build on feature branches, push only on main branch | |
push: ${{ github.ref == 'refs/heads/master' }} | |
- name: Image digest | |
run: echo ${{ steps.docker_build.outputs.digest }} |