Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ jobs:
'export AWS_REGION=${{ env.AWS_REGION }}',
'export ECR_REGISTRY=${ECR_REGISTRY}',
'export IMAGE_TAG=${IMAGE_TAG}',
'export GITHUB_REPO=${{ github.repository }}',
'export COMMIT_SHA=${{ github.event.workflow_run.head_sha }}',
'bash /tmp/deploy.sh'
]" \
--timeout-seconds 600 \
Expand Down
7 changes: 7 additions & 0 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ set -euo pipefail
AWS_REGION="${AWS_REGION:-ap-northeast-2}"
ECR_REGISTRY="${ECR_REGISTRY:?ERROR: ECR_REGISTRY must be set}"
IMAGE_TAG="${IMAGE_TAG:-latest}"
GITHUB_REPO="${GITHUB_REPO:?ERROR: GITHUB_REPO must be set}"
COMMIT_SHA="${COMMIT_SHA:-main}"

APP_DIR="/home/ubuntu/notification-worker"
mkdir -p "$APP_DIR"
Expand All @@ -13,6 +15,11 @@ cd "$APP_DIR"
echo "=== Ditda Notification Worker 배포 ==="
echo "Image: ${ECR_REGISTRY}:${IMAGE_TAG}"

# === 최신 설정 파일 fetch (GitHub raw) ===
echo "[0/5] 설정 파일 가져오기"
RAW_BASE="https://raw.githubusercontent.com/${GITHUB_REPO}/${COMMIT_SHA}"

curl -fsSL "${RAW_BASE}/docker-compose.prod.yaml" -o docker-compose.prod.yaml

# === ECR 로그인 ===
echo "[1/5] ECR 로그인"
Expand Down