Skip to content

Commit

Permalink
main - add : adding github action file and dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
MohamedJamh committed Mar 27, 2024
1 parent 90ccc68 commit f203504
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/PushImageToDockerHub.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Push Image To Docker Hub
on:
release:
types:
- published
jobs:
push_to_docker_hub:
name: Push To Docker Hub
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/property-management-service:${{ github.event.release.tag_name }}
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM maven:3.9.5-amazoncorretto-17 AS build
COPY . /app
WORKDIR /app
RUN mvn package -DskipTests -U

FROM openjdk:17
COPY --from=build /app/target/property-management-service.jar property-management-service
ENTRYPOINT ["java", "-jar","property-management-service"]
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@
</configuration>
</plugin>
</plugins>
<finalName>property-management-service</finalName>
</build>

</project>

0 comments on commit f203504

Please sign in to comment.