From e5c3a5e615c5d67952bdee8df159845e80d71de3 Mon Sep 17 00:00:00 2001 From: ParkJiYeoung8297 Date: Fri, 16 Jan 2026 16:37:37 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix(#7):=20CI=EC=99=80=20CD=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95=20=ED=8C=8C=EC=9D=BC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd-prod.yml | 16 +++++++++++--- .github/workflows/pr-check.yml | 22 ++++++++++--------- build.gradle | 3 --- .../global/config/SecurityConfig.java | 4 ++-- src/main/resources/application-prod.yml | 2 +- src/main/resources/application-test.yml | 10 ++++----- 6 files changed, 33 insertions(+), 24 deletions(-) diff --git a/.github/workflows/cd-prod.yml b/.github/workflows/cd-prod.yml index cc9f1d4b..5d68986b 100644 --- a/.github/workflows/cd-prod.yml +++ b/.github/workflows/cd-prod.yml @@ -36,8 +36,8 @@ jobs: context: . push: true tags: | - ${{ secrets.DOCKERHUB_USERNAME }}/spot-backend:prod - ${{ secrets.DOCKERHUB_USERNAME }}/spot-backend:${{ github.sha }} + ${{ secrets.DOCKERHUB_USERNAME }}/realmatch-backend:prod + ${{ secrets.DOCKERHUB_USERNAME }}/realmatch-backend:${{ github.sha }} - name: Deploy uses: appleboy/ssh-action@v1.0.3 @@ -46,7 +46,17 @@ jobs: username: ubuntu key: ${{ secrets.PROD_SERVER_SSH_KEY }} script: | - cd /home/ubuntu/spot + cd /home/ubuntu/realmatch git pull origin main + docker compose pull docker compose up -d + + echo "Waiting for app to start..." + sleep 10 + + if ! docker compose ps | grep "Up"; then + echo "❌ Container is not running" + docker compose logs + exit 1 + fi \ No newline at end of file diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index ce2c3228..5b5dbb93 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -9,19 +9,21 @@ jobs: runs-on: ubuntu-latest services: - postgres: - image: postgres:16 + mysql: + image: mysql:8.0 env: - POSTGRES_DB: myapp_db - POSTGRES_USER: admin - POSTGRES_PASSWORD: secret + MYSQL_DATABASE: test_db + MYSQL_USER: test_user + MYSQL_PASSWORD: test + MYSQL_ROOT_PASSWORD: test_root ports: - - 5432:5432 + - 3306:3306 options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 + --health-cmd="mysqladmin ping -h 127.0.0.1 -uroot -ptest_root" + --health-interval=10s + --health-timeout=5s + --health-retries=5 + env: SPRING_PROFILES_ACTIVE: test diff --git a/build.gradle b/build.gradle index 8f359a16..f490a7e2 100644 --- a/build.gradle +++ b/build.gradle @@ -55,9 +55,6 @@ dependencies { // swagger implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.9' - - // postgresql (CI test 용) - runtimeOnly 'org.postgresql:postgresql' } tasks.named('test') { diff --git a/src/main/java/com/example/RealMatch/global/config/SecurityConfig.java b/src/main/java/com/example/RealMatch/global/config/SecurityConfig.java index 1f558a40..c1bfe019 100644 --- a/src/main/java/com/example/RealMatch/global/config/SecurityConfig.java +++ b/src/main/java/com/example/RealMatch/global/config/SecurityConfig.java @@ -26,12 +26,12 @@ public class SecurityConfig { private final JwtAuthenticationFilter jwtAuthenticationFilter; private static final String[] PERMIT_ALL_URL_ARRAY = { - "/api/v1/test", + "/api/test", "/v3/api-docs/**", "/swagger-ui/**", "/swagger-resources/**", "/swagger-ui.html" }; private static final String[] REQUEST_AUTHENTICATED_ARRAY = { - "/api/v1/test-auth" + "/api/test-auth" }; @Value("${cors.allowed-origin}") diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml index 83a0b6ef..074981e3 100644 --- a/src/main/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -9,7 +9,7 @@ server: spring: application: - name: Spot + name: Realmatch activate: on-profile: prod diff --git a/src/main/resources/application-test.yml b/src/main/resources/application-test.yml index 41ce166c..b75ce2f9 100644 --- a/src/main/resources/application-test.yml +++ b/src/main/resources/application-test.yml @@ -9,13 +9,13 @@ server: spring: application: - name: Spot + name: Realmatch datasource: - url: jdbc:postgresql://localhost:5432/myapp_db - username: admin - password: secret - driver-class-name: org.postgresql.Driver + url: jdbc:mysql://localhost:3306/test_db + username: test_user + password: test + driver-class-name: com.mysql.cj.jdbc.Driver hikari: maximum-pool-size: 10 minimum-idle: 5 From 1fd6932424ea53f88c02111bd03287f58ef83a68 Mon Sep 17 00:00:00 2001 From: ParkJiYeoung8297 Date: Fri, 16 Jan 2026 17:01:03 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix(#7):=20postgresql=EC=97=90=EC=84=9C=20m?= =?UTF-8?q?ysql=EB=A1=9C=20=EC=84=A4=EC=A0=95=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/application-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/application-test.yml b/src/main/resources/application-test.yml index b75ce2f9..d2881f5b 100644 --- a/src/main/resources/application-test.yml +++ b/src/main/resources/application-test.yml @@ -28,7 +28,7 @@ spring: ddl-auto: none properties: hibernate: - dialect: org.hibernate.dialect.PostgreSQLDialect + dialect: org.hibernate.dialect.MySQL8Dialect format_sql: true show-sql: false