Skip to content

feat: prod 배포 환경 구축 (#39) - #41

Merged
young0206 merged 4 commits into
developfrom
feature/39-prod-infra
Jul 22, 2026
Merged

young0206 merged 4 commits into
developfrom
feature/39-prod-infra

Conversation

@young0206

@young0206 young0206 commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

🔗 관련 이슈 (Related Issue)

Closes #39

📝 작업 내용

  • prod 환경 자동 배포 구성

    • main 브랜치 머지 시 prod EC2로 자동 배포되도록 GitHub Actions CD 설정 추가
    • prod 환경용 배포 workflow 추가
  • prod 서버 인프라 구성

    • prod EC2 환경 설정
    • prod systemd 서비스 설정 추가
    • prod 환경변수 설정 구성
    • prod 배포 스크립트 구성
  • dev/prod 환경 분리

    • RDS는 하나의 인스턴스를 사용하고 DB는 slatto_dev, slatto_prod로 분리
    • prod 환경은 별도 DB를 사용하도록 구성
  • 운영 환경 설정 추가

    • prod 환경 Swagger 비활성화 설정 추가
    • dev/prod profile 분리

✅ PR 체크리스트

  • PR 제목은 커밋 컨벤션을 따랐습니다.
  • 관련 이슈를 연결했습니다.
  • 변경 사항에 대한 테스트를 진행했습니다.

Summary by CodeRabbit

  • 새로운 기능
    • main 브랜치 변경 사항을 기반으로 프로덕션 환경에 자동 배포하는 기능을 추가했습니다.
    • 애플리케이션 빌드 후 배포 서버로 전송하고 원격 배포를 자동 실행합니다.
    • 중복 배포 실행을 방지하도록 배포 작업을 관리합니다.

@young0206 young0206 self-assigned this Jul 22, 2026
@young0206 young0206 added the feature 새로운 기능 추가 label Jul 22, 2026
@coderabbitai

coderabbitai Bot commented Jul 22, 2026 •

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b93222f7-48e5-4b72-8a88-f523a9c323dc

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

main 브랜치 푸시 시 실행되는 프로덕션 GitHub Actions 워크플로우를 추가했습니다. Java 21과 Gradle로 JAR을 빌드하고, SCP와 SSH를 사용해 EC2에 전송 및 배포합니다.

Changes

프로덕션 배포

Layer / File(s) Summary
배포 트리거 및 실행 제어
.github/workflows/cd-prod.yml
main 브랜치 푸시를 트리거로 사용하고, contents: read 권한과 deploy-prod 동시성 그룹을 설정합니다.
빌드 및 EC2 배포
.github/workflows/cd-prod.yml
Java 21 환경에서 테스트를 제외한 bootJar를 생성하고, GitHub Secrets로 주입된 접속 정보를 사용해 JAR을 EC2로 전송한 뒤 원격 배포 스크립트를 실행합니다.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant GitHub Actions
  participant Gradle
  participant EC2
  participant deploy.sh
  GitHub Actions->>Gradle: bootJar 빌드
  GitHub Actions->>EC2: JAR 파일 SCP 전송
  GitHub Actions->>deploy.sh: SSH로 배포 스크립트 실행
  deploy.sh->>EC2: 애플리케이션 배포
Loading

Possibly related PRs

  • SLAT-TO/SLAT-TO-BE#38: 동일한 EC2 경로와 SCP/SSH 방식을 사용하는 개발 환경 배포 워크플로우를 추가합니다.

Suggested labels: feature

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed 제목이 prod 배포 환경 구축이라는 주요 변경 사항을 간결하게 설명합니다.
Description check ✅ Passed 관련 이슈, 작업 내용, 체크리스트가 템플릿 구조를 대부분 충족합니다.
Linked Issues check ✅ Passed cd-prod.yml 추가와 main 푸시 자동 배포, prod 전용 워크플로우 분리가 #39의 핵심 요구를 충족합니다.
Out of Scope Changes check ✅ Passed 변경은 prod 배포용 GitHub Actions 워크플로우 추가로 한정되어 이슈 범위 밖 변경이 보이지 않습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/cd-prod.yml:
- Around line 36-37: Update the deployment workflow around the “Build Spring
Boot jar” step and the subsequent deploy.sh execution: remove the -x test
exclusion so tests are mandatory, then add a post-deployment health-check step
that polls the application health endpoint until it succeeds or a defined
timeout is reached. Ensure timeout or unhealthy responses produce a nonzero exit
status so the workflow fails.
- Line 39: Update the “Copy jar to EC2” workflow step to avoid hardcoding the
versioned JAR path. Configure a stable Gradle bootJar archive name and reference
that name in the SCP command, or derive the actual bootJar output during the
build and pass it to this step so version changes do not break deployment.
- Line 22: 프로덕션 배포 워크플로의 actions/checkout, actions/setup-java,
appleboy/scp-action, appleboy/ssh-action 사용을 변경 가능한 버전 태그에서 해당 액션의 전체 커밋 SHA로
고정하세요. 각 uses 항목의 기존 버전 주석은 유지하고, cd-prod.yml의 네 배포 액션 참조만 수정하세요.
- Around line 11-13: Update the production workflow’s concurrency configuration
by changing cancel-in-progress from true to false, so new main pushes queue
behind the active deployment instead of cancelling it. Preserve the existing
deploy-prod concurrency group and avoid introducing concurrent deployment
behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c071d715-f8fd-4f47-b5a0-0bb911558f01

📥 Commits

Reviewing files that changed from the base of the PR and between f7bcba0 and 61e62db.

📒 Files selected for processing (1)
  • .github/workflows/cd-prod.yml

Comment thread .github/workflows/cd-prod.yml Outdated

steps:
- name: Checkout
uses: actions/checkout@v4

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Show the workflow file with line numbers around the referenced ranges.
file=".github/workflows/cd-prod.yml"
wc -l "$file"
sed -n '1,140p' "$file" | cat -n

Repository: SLAT-TO/SLAT-TO-BE

Length of output: 2071


🏁 Script executed:

#!/bin/bash
set -euo pipefail

file=".github/workflows/cd-prod.yml"
wc -l "$file"
sed -n '1,140p' "$file" | cat -n

Repository: SLAT-TO/SLAT-TO-BE

Length of output: 2071


🏁 Script executed:

#!/bin/bash
set -euo pipefail
file=".github/workflows/cd-prod.yml"
wc -l "$file"
sed -n '1,140p' "$file" | cat -n

Repository: SLAT-TO/SLAT-TO-BE

Length of output: 2071


프로덕션 배포 액션을 커밋 SHA로 고정하세요. .github/workflows/cd-prod.yml의 22, 27, 40, 50행에서 actions/checkout@v4, actions/setup-java@v4, appleboy/scp-action@v1, appleboy/ssh-action@v1가 변경 가능한 태그를 사용합니다. 배포 경로에서는 태그 이동만으로 동작이 바뀔 수 있으니 전체 커밋 SHA로 바꾸고 버전 주석은 유지하세요.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/cd-prod.yml at line 22, 프로덕션 배포 워크플로의 actions/checkout,
actions/setup-java, appleboy/scp-action, appleboy/ssh-action 사용을 변경 가능한 버전 태그에서
해당 액션의 전체 커밋 SHA로 고정하세요. 각 uses 항목의 기존 버전 주석은 유지하고, cd-prod.yml의 네 배포 액션 참조만
수정하세요.

Comment thread .github/workflows/cd-prod.yml Outdated
Comment thread .github/workflows/cd-prod.yml
@young0206
young0206 merged commit cb016d8 into develop Jul 22, 2026
2 checks passed
@young0206
young0206 deleted the feature/39-prod-infra branch July 22, 2026 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature 새로운 기능 추가

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FEAT: Prod 배포 환경 구축

2 participants