Skip to content

Commit 51af58b

Browse files
Github actions flow docker push to docker hub
1 parent 6e7e29c commit 51af58b

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

.github/workflows/maven.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,12 @@ jobs:
2929
cache: maven
3030
- name: Build with Maven
3131
run: mvn clean install
32+
- name: Build & Push Docker image
33+
uses: mr-smithers-excellent/docker-build-push@v5
34+
with:
35+
image: sabarishdocker1991/springboot-githubaction-flow.jar
36+
tags: latest
37+
registry: docker.io
38+
dockerfile: Dockerfile
39+
username: ${{ secrets.DOCKER_USERNAME }}
40+
password: ${{ secrets.DOCKER_PASSWORD }}

Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM openjdk:17-jdk-alpine
2+
EXPOSE 8092
3+
COPY target/springboot-githubaction-flow.jar springboot-githubaction-flow.jar
4+
ENTRYPOINT ["java", "-jar", "springboot-githubaction-flow.jar"]

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
<artifactId>spring-boot-maven-plugin</artifactId>
5050
</plugin>
5151
</plugins>
52+
<finalName>springboot-githubaction-flow</finalName>
5253
</build>
5354

5455
</project>

0 commit comments

Comments
 (0)