diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index e0d8da8..78450da 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -38,4 +38,17 @@ jobs: REDIS_HOST: ${{ vars.REDIS_HOST }} REDIS_USER: ${{ vars.REDIS_USER }} REDIS_PASS: ${{ vars.REDIS_PASS }} - REDIS_PORT: ${{ vars.REDIS_PORT }} \ No newline at end of file + REDIS_PORT: ${{ vars.REDIS_PORT }} + + - name: login to docker registry + uses: docker/login-action@v3 + with: + username: ${{secrets.DOCKERHUB_USERNAME}} + password: ${{secrets.DOCKERHUB_TOKEN}} + + - name: build and push docker image to registry + uses: docker/build-push-action@v5 + with: + context: Dockerfile + push: true + tags: kushparsaniya/spotify-youtube-sync-github-action:latest \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2caaf98 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +# Use an official OpenJDK 21 runtime as a parent image +FROM eclipse-temurin:21-jdk + +ADD target/spotify-youtube-sync-github-action.war spotify-youtube-sync-github-action.war + +# Make port 8080 available to the world outside this container +EXPOSE 8080 + +# Run the WAR file using Tomcat +ENTRYPOINT ["java", "-jar", "/spotify-youtube-sync-github-action.war"] \ No newline at end of file diff --git a/pom.xml b/pom.xml index 4c36b39..0efb9b0 100644 --- a/pom.xml +++ b/pom.xml @@ -95,6 +95,7 @@ + spotify-youtube-sync-github-action org.graalvm.buildtools