Skip to content
Open
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
33 changes: 33 additions & 0 deletions .github/workflows/ci-cd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Deploy to Elastic Beanstalk

on:
push:
branches:
- deploy/deploy-on-aws-elastic-beanstalk



jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Source
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Build Project
run: mvn clean install -DskipTests
- name: Deploy to EB
uses: einaregilsson/beanstalk-deploy@v21
with:
aws_access_key: ${{ secrets.AWS_ACCESS_KEY }}
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
application_name: 'springboot-user-curd-app'
environment_name: 'springboot-user-curd-app-env'
region: ap-south-1
version_label: ${{ github.sha }}-${{ github.run_number }}
deployment_package: target/springboot-user-crud-0.0.1-SNAPSHOT.jar
use_existing_version_if_available: true # ← ADD THIS
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
/src/test
/target
/.mvn/
/SpringBoot-AWS-EC2-Guide.md
7 changes: 3 additions & 4 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

spring.datasource.url=jdbc:mysql://localhost:3306/springboot_crud
spring.datasource.username=springboot_crud
spring.datasource.url=jdbc:mysql://springboot-crud-db.cv6oe0kkeu4l.ap-south-1.rds.amazonaws.com:3306/springboot_crud
spring.datasource.username=admin
spring.datasource.password=1234567890

spring.jpa.hibernate.ddl-auto=update
spring.jpa.hibernate.ddl-auto=none
spring.jpa.show-sql=true
spring.jpa.open-in-view=false
spring.flyway.enabled=false
Expand All @@ -13,7 +13,6 @@ spring.jpa.database-platform=org.hibernate.dialect.MySQL8Dialect
logging.level.org.hibernate.SQL=DEBUG
logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE

server.port=9192

spring.mail.host=smtp.gmail.com
spring.mail.port=587
Expand Down
Loading