diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ee0ff9b3..b381e1df 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -55,17 +55,18 @@ jobs: runs-on: ubuntu-latest needs: build steps: - - name: Checkout repository - uses: actions/checkout@v3 - - name: Download production-ready build files - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v2 with: name: example-app - - name: Deploy to Heroku - uses: akhileshns/heroku-deploy@v3.12.14 + - name: Build, Push and Release a Docker container to Heroku + uses: gonuit/heroku-docker-deploy@v1.3.3 with: - heroku_api_key: ${{secrets.HEROKU_API_KEY}} - heroku_app_name: "jobjugglerapi" - heroku_email: "vegardrsmines@gmail.com" + email: ${{ secrets.HEROKU_EMAIL }} + heroku_api_key: ${{ secrets.HEROKU_API_KEY }} + heroku_app_name: jobjugglerapi + dockerfile_directory: ./ + dockerfile_name: dockerfile + docker_options: "--no-cache" + process_type: web diff --git a/dockerfile b/dockerfile new file mode 100644 index 00000000..586c742c --- /dev/null +++ b/dockerfile @@ -0,0 +1,12 @@ +# Use the official OpenJDK base image +FROM openjdk:17-jdk-slim + +# Set the working directory inside the container +WORKDIR /app + +COPY ./*.jar /app/app.jar + +EXPOSE 8081 + +# Command to run the application +CMD ["java", "-jar", "/app/app.jar"] \ No newline at end of file diff --git a/example-app/dockerfile b/example-app/dockerfile deleted file mode 100644 index e69de29b..00000000