Skip to content

Commit

Permalink
Trying docker heroku deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
vegarrsm committed Aug 31, 2023
1 parent 4453693 commit d29f039
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 10 deletions.
22 changes: 13 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,18 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

- name: Download production-ready build files
uses: actions/download-artifact@v3
with:
name: production-files
- name: Login to Heroku Container Registry
run: docker login --username=$HEROKU_EMAIL --password=$HEROKU_API_KEY registry.heroku.com

- name: Build and push Docker image
run: |
docker build -t registry.heroku.com/jobjugglerapi/web .
docker push registry.heroku.com/jobjugglerapi/web
- name: Deploy to Heroku
uses: akhileshns/[email protected]
with:
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
heroku_app_name: "jobjugglerapi"
heroku_email: "[email protected]"
run: |
heroku container:release web --app jobjugglerapi
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
HEROKU_EMAIL: ${{ secrets.HEROKU_EMAIL }}
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
web: java -jar *.jar
web: java -jar db-scheduler-ui-backend/target/*.jar
14 changes: 14 additions & 0 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Use the official OpenJDK base image
FROM openjdk:17-jdk-slim

# Set the working directory inside the container
WORKDIR /app

# Copy the JAR file into the image
COPY ./db-scheduler-ui-backend/target/db-scheduler-ui-backend-0.0.1-SNAPSHOT.jar /app/app.jar

# Expose port 8080 for the application
EXPOSE 8081

# Command to run the application
CMD ["java", "-jar", "/app/app.jar"]

0 comments on commit d29f039

Please sign in to comment.