Skip to content

Commit

Permalink
test: deploy test
Browse files Browse the repository at this point in the history
  • Loading branch information
gyehyun-bak committed Oct 24, 2024
1 parent 75eec4f commit bc7d44d
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@ jobs:
key: ${{ secrets.EC2_PRIVATE_KEY }}
script_stop: true
script: |
# 네트워크 생성
docker network create cano-network || true
# 네트워크 생성 (이미 존재할 경우 무시)
docker network create cano-network || echo "Network already exists"
# MySQL 컨테이너 중지 및 삭제
docker stop mysql-container || true
docker rm mysql-container || true
# MySQL 이미지 풀
docker pull mysql:5.7
# MySQL 컨테이너 실행
docker run -d --name mysql-container \
--network cano-network \ # 네트워크 지정
Expand All @@ -74,16 +74,19 @@ jobs:
-v mysql-data:/var/lib/mysql \
-p 3306:3306 \
mysql:5.7
# 기존 Spring Boot 컨테이너 중지 및 삭제
docker stop cano-server || true
docker rm cano-server || true
# Spring Boot 이미지 풀
docker pull ${{ steps.login-ecr.outputs.registry }}/cano-server:latest
# Spring Boot 컨테이너 실행
docker run -d --name cano-server \
--network cano-network \ # 네트워크 지정
-p 8080:8080 \
-e SPRING_DATASOURCE_URL=jdbc:mysql://mysql-container:3306/cano \ # MySQL 컨테이너 이름으로 수정
-e SPRING_DATASOURCE_USERNAME=root \
-e SPRING_DATASOURCE_PASSWORD=password123 \
${{ steps.login-ecr.outputs.registry }}/cano-server:latest

0 comments on commit bc7d44d

Please sign in to comment.