Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed heroku deploy #19

Merged
merged 7 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,20 @@ jobs:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Checkout repo
uses: actions/checkout@v3
- name: Download production-ready build files
uses: actions/download-artifact@v3
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: "[email protected]"
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
12 changes: 12 additions & 0 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Use the official OpenJDK base image
FROM openjdk:11-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"]
2 changes: 1 addition & 1 deletion example-app/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
server.port=8081
server.port=${PORT:8081}
spring.datasource.url=jdbc:h2:file:./db-scheduler-application/test-db;MODE=PostgreSQL;DATABASE_TO_LOWER=TRUE;DEFAULT_NULL_ORDERING=HIGH
spring.datasource.driver-class-name=org.h2.Driver
3 changes: 3 additions & 0 deletions heroku.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build:
docker:
web: dockerfile