Skip to content

Merge pull request #23 from Genc/develop #6

Merge pull request #23 from Genc/develop

Merge pull request #23 from Genc/develop #6

Workflow file for this run

name: Build Maven Package And Publish Docker Image
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Extract Project Version
run: echo "version=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)" >> $GITHUB_OUTPUT
id: project
- name: Show Project version
run: echo ${{steps.project.outputs.version}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: omerfarukgenc34/spring-boot-boilerplate:${{steps.project.outputs.version}}