File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Deploy Crew App
2+
3+ on :
4+ push :
5+ branches :
6+ - develop
7+
8+ jobs :
9+ deploy :
10+ runs-on : ubuntu-latest
11+
12+ steps :
13+ - name : Checkout
14+ uses : actions/checkout@v4
15+
16+ - name : SSH to EC2 and deploy
17+ uses : appleboy/ssh-action@master
18+ with :
19+ host : ${{ secrets.EC2_HOST }}
20+ username : ${{ secrets.EC2_USER }}
21+ key : ${{ secrets.EC2_PRIVATE_KEY }}
22+ script : |
23+ docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
24+ docker pull bjisu/crew-app:latest
25+ docker stop crew-app || true
26+ docker rm crew-app || true
27+ docker run -d --name crew-app -p 8080:8080 \
28+ -e DB_USERNAME=${{ secrets.DB_USERNAME }} \
29+ -e DB_PASSWORD=${{ secrets.DB_PASSWORD }} \
30+ bjisu/crew-app:latest
Original file line number Diff line number Diff line change 1+ FROM openjdk:21-jdk-slim
2+
3+ WORKDIR /app
4+
5+ COPY build/libs/*.jar app.jar
6+
7+ ENV SPRING_PROFILES_ACTIVE=prod
8+
9+ EXPOSE 8080
10+
11+ ENTRYPOINT ["java" , "-jar" , "app.jar" ]
Original file line number Diff line number Diff line change 11spring :
22 application :
33 name : crew
4- # JPA
4+ # JPA
55 datasource :
6- driver-class-name : org.h2.Driver
7- url : jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;MODE=MySQL
6+ driver-class-name : com.mysql.cj.jdbc.Driver
7+ url : jdbc:mysql://retripstudydb.cv4sss0i0mk8.ap-southeast-2.rds.amazonaws.com:3306/crew?serverTimezone=Asia/Seoul&characterEncoding=UTF-8
8+ username : ${DB_USERNAME}
9+ password : ${DB_PASSWORD}
810 jpa :
911 hibernate :
10- ddl-auto : create-drop
12+ ddl-auto : update
1113 properties :
1214 hibernate :
1315 show_sql : true
You can’t perform that action at this time.
0 commit comments