File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7373 fi
7474 echo "Lambda ZIP 파일 생성 확인 ($(du -h build/distributions/main-1.1.2-lambda.zip | cut -f1))"
7575
76+ # Step 3.5: Clean up failed stack if exists
77+ - name : Clean up failed stack
78+ run : |
79+ STACK_STATUS=$(aws cloudformation describe-stacks --stack-name sopt-crew-dev --query 'Stacks[0].StackStatus' --output text --region ap-northeast-2 2>/dev/null || echo "NONE")
80+
81+ if [ "$STACK_STATUS" = "ROLLBACK_COMPLETE" ]; then
82+ echo "⚠️ 스택이 ROLLBACK_COMPLETE 상태입니다. 삭제 중..."
83+ aws cloudformation delete-stack --stack-name sopt-crew-dev --region ap-northeast-2
84+ echo "스택 삭제 대기 중..."
85+ aws cloudformation wait stack-delete-complete --stack-name sopt-crew-dev --region ap-northeast-2
86+ echo "✅ 스택 삭제 완료"
87+ elif [ "$STACK_STATUS" = "NONE" ]; then
88+ echo "새로운 스택을 생성합니다."
89+ else
90+ echo "현재 스택 상태: $STACK_STATUS"
91+ fi
92+
7693 # Step 4: Deploy with SAM
7794 - name : Deploy to AWS Lambda
7895 id : deploy
You can’t perform that action at this time.
0 commit comments