Skip to content

Commit

Permalink
Merge pull request #121 from addianto/enhancement/build-docker-hub
Browse files Browse the repository at this point in the history
Build & publish Docker image using GitHub Workflow
  • Loading branch information
arey authored Oct 30, 2023
2 parents 699abf2 + 4c78577 commit 6fbb100
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 4 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Build to Docker Hub

on:
push:
branches: [master]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Build & publish the project
run: mvn compile jib:build -X -DjibSerialize=true
2 changes: 1 addition & 1 deletion .github/workflows/maven-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'adopt'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B install --file pom.xml -Djacoco.skip=true -DdisableXmlReport=true
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</parent>

<properties>
<!-- Third librairies -->
<!-- Third-party libraries -->
<spring-data-jdbc.version>1.2.1.RELEASE</spring-data-jdbc.version>
<springdoc-openapi-ui.version>2.0.2</springdoc-openapi-ui.version>
<jackson-databind-nullable.version>0.2.1</jackson-databind-nullable.version>
Expand All @@ -31,7 +31,7 @@
<build-helper-maven-plugin.version>3.2.0</build-helper-maven-plugin.version>

<!-- Docker -->
<docker.jib-maven-plugin.version>1.3.0</docker.jib-maven-plugin.version>
<docker.jib-maven-plugin.version>3.4.0</docker.jib-maven-plugin.version>
<docker.image.prefix>springcommunity</docker.image.prefix>
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
</properties>
Expand Down
3 changes: 2 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# REST version of Spring PetClinic Sample Application (spring-framework-petclinic extend )

[![Build Status](https://github.com/spring-petclinic/spring-petclinic-rest/actions/workflows/maven-build.yml/badge.svg)](https://github.com/spring-petclinic/spring-petclinic-rest/actions/workflows/maven-build.yml)
[![Java Build Status](https://github.com/spring-petclinic/spring-petclinic-rest/actions/workflows/maven-build.yml/badge.svg)](https://github.com/spring-petclinic/spring-petclinic-rest/actions/workflows/maven-build.yml)
[![Docker Build Status](https://github.com/spring-petclinic/spring-petclinic-rest/actions/workflows/docker-build.yml/badge.svg)](https://github.com/spring-petclinic/spring-petclinic-rest/actions/workflows/docker-build.yml)

This backend version of the Spring Petclinic application only provides a REST API. **There is no UI**.
The [spring-petclinic-angular project](https://github.com/spring-petclinic/spring-petclinic-angular) is a Angular front-end application which consumes the REST API.
Expand Down

0 comments on commit 6fbb100

Please sign in to comment.