Skip to content

πŸ›fix: μ—λŸ¬ νŽ˜μ΄μ§€ λ¦¬λ‹€μ΄λž™νŠΈ 문제 μˆ˜μ • #58

πŸ›fix: μ—λŸ¬ νŽ˜μ΄μ§€ λ¦¬λ‹€μ΄λž™νŠΈ 문제 μˆ˜μ •

πŸ›fix: μ—λŸ¬ νŽ˜μ΄μ§€ λ¦¬λ‹€μ΄λž™νŠΈ 문제 μˆ˜μ • #58

Workflow file for this run

name: Deploy to EC2
on:
pull_request:
types: [closed]
branches: [main, develop]
env:
DOCKER_CONTAINER_NAME: coplan-app
jobs:
warmup:
# πŸ›‘οΈ λ¨Έμ§€λœ κ²½μš°μ—λ§Œ μ‹€ν–‰
if: github.event.pull_request.merged == true
runs-on: self-hosted
timeout-minutes: 3
steps:
- name: Environment check
run: |
echo "=== Deployment System Check ==="
echo "πŸ“‹ Merged PR: ${{ github.event.pull_request.title }}"
echo "πŸ‘€ Author: ${{ github.event.pull_request.user.login }}"
echo "πŸ”„ From: ${{ github.event.pull_request.head.ref }} β†’ ${{ github.event.pull_request.base.ref }}"
echo "πŸ“ Commit: ${{ github.event.pull_request.merge_commit_sha }}"
echo ""
echo "πŸ–₯️ System Status:"
whoami
docker --version
free -h
echo ""
echo "🐳 Container Status:"
docker ps
deploy:
needs: warmup
runs-on: self-hosted
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Execute deployment script
run: |
echo "πŸš€ Starting deployment..."
echo "πŸ”„ Branch: ${{ github.ref_name }}"
echo "πŸ”„ Commit: ${{ github.sha }}"
echo "πŸ“¦ PR: #${{ github.event.pull_request.number }}"
# deploy.sh μ‹€ν–‰
cd /home/ubuntu/coplan
chmod +x ./deploy.sh
./deploy.sh
- name: Health check
run: |
echo "πŸ₯ Health checking..."
sleep 15
if docker ps | grep -q $DOCKER_CONTAINER_NAME; then
echo "βœ… Deployment completed successfully!"
echo "πŸ“Š Container status:"
docker ps | grep $DOCKER_CONTAINER_NAME
echo ""
echo "πŸ“ Recent logs:"
docker logs --tail 5 $DOCKER_CONTAINER_NAME
echo ""
echo "🌐 Service available at: https://coplan.work"
else
echo "❌ Deployment failed!"
echo "πŸ” Checking container logs..."
docker logs $DOCKER_CONTAINER_NAME 2>/dev/null || echo "No container logs available"
echo "πŸ” Checking system status..."
docker ps -a
free -h
exit 1
fi