Skip to content

feat: 배포 전 stage/prod DB 자동 백업 단계 추가#264

Merged
dh2906 merged 1 commit intodevelopfrom
feat/deploy-db-dumps
Feb 18, 2026
Merged

feat: 배포 전 stage/prod DB 자동 백업 단계 추가#264
dh2906 merged 1 commit intodevelopfrom
feat/deploy-db-dumps

Conversation

@dh2906
Copy link
Contributor

@dh2906 dh2906 commented Feb 18, 2026

🔍 개요

  • close #이슈번호

🚀 주요 변경 내용

  • 배포 전 깃허브 액션에서 DB 덤프 작업을 합니다.

  • 덤프 파일은 최대 5일 보관합니다.


💬 참고 사항


✅ Checklist (완료 조건)

  • 코드 스타일 가이드 준수
  • 테스트 코드 포함됨
  • Reviewers / Assignees / Labels 지정 완료
  • 보안 및 민감 정보 검증 (API 키, 환경 변수, 개인정보 등)

Summary by CodeRabbit

  • Chores
    • Added automated database backup step to production and staging deployment workflows
    • Database backups are now created automatically before deployments begin
    • Old backups (older than 5 days) are automatically removed to manage storage

@dh2906 dh2906 self-assigned this Feb 18, 2026
@dh2906 dh2906 merged commit 32eb002 into develop Feb 18, 2026
1 of 2 checks passed
@coderabbitai
Copy link

coderabbitai bot commented Feb 18, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Two GitHub Actions workflows gain pre-deployment database backup steps that execute SSH commands to connect to production and staging servers, creating timestamped MySQL dumps, cleaning up old backups beyond five days, and verifying backup integrity before proceeding with deployment.

Changes

Cohort / File(s) Summary
Database Backup Workflows
.github/workflows/deploy-prod.yml, .github/workflows/deploy-stage.yml
Added "Backup [prod|stage] database before deploy" steps that use SSH to execute mysqldump operations with environment variable validation, old backup cleanup (>5 days), and dump file verification on respective servers before deployment proceeds.

Sequence Diagram

sequenceDiagram
    participant GHA as GitHub Actions
    participant SSH as SSH Connection
    participant Server as Prod/Stage Server
    participant FS as Filesystem
    participant MySQL as MySQL Database

    GHA->>SSH: Establish SSH connection with credentials
    SSH->>Server: Connect to remote server
    Server->>FS: Load .env file for environment variables
    Server->>FS: Create dumps directory
    Server->>FS: Remove backups older than 5 days
    Server->>MySQL: Execute mysqldump with options
    MySQL->>FS: Write database dump to timestamped file
    Server->>FS: Verify dump file is non-empty
    FS->>GHA: Confirm backup success, proceed to deploy
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰✨ A backup before the deploy we go,
MySQL dumps safe, in a row so neat,
Old files swept away, five days must know,
Prod and stage servers, dancing to the beat! 🎯

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/deploy-db-dumps

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments