feat: Gitea Actions 기반 자동배포 워크플로우 업데이트
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
+18
-17
@@ -12,31 +12,32 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Create .env.production
|
||||
- name: Pull latest code
|
||||
run: |
|
||||
cat > .env.production << 'ENVEOF'
|
||||
DB_USER=${{ secrets.DB_USER }}
|
||||
DB_PASSWORD=${{ secrets.DB_PASSWORD }}
|
||||
DB_NAME=${{ secrets.DB_NAME }}
|
||||
REDIS_PASSWORD=${{ secrets.REDIS_PASSWORD }}
|
||||
NEXTAUTH_URL=${{ secrets.NEXTAUTH_URL }}
|
||||
NEXTAUTH_SECRET=${{ secrets.NEXTAUTH_SECRET }}
|
||||
ENVEOF
|
||||
cd /home/three/startover/repo
|
||||
git fetch origin
|
||||
git reset --hard origin/main
|
||||
echo "Current commit: $(git log --oneline -1)"
|
||||
|
||||
- name: Copy environment file
|
||||
run: |
|
||||
cp /home/three/startover/.env.production /home/three/startover/repo/.env.production
|
||||
|
||||
- name: Build and Deploy
|
||||
run: |
|
||||
cd /home/three/startover/repo
|
||||
docker compose -f docker-compose.prod.yml --env-file .env.production up -d --build --remove-orphans
|
||||
|
||||
- name: Run database migrations
|
||||
run: |
|
||||
docker compose -f docker-compose.prod.yml exec -T web sh -c "cd /app && npx prisma migrate deploy" || echo "Migration skipped (first deploy)"
|
||||
- name: Wait for services
|
||||
run: sleep 15
|
||||
|
||||
- name: Health check
|
||||
run: |
|
||||
echo "Waiting for services to start..."
|
||||
sleep 10
|
||||
curl -f http://localhost/health || echo "Health check pending - services may still be starting"
|
||||
if curl -sf http://localhost/health > /dev/null 2>&1; then
|
||||
echo "Health check PASSED"
|
||||
else
|
||||
echo "WARNING: Health check pending"
|
||||
fi
|
||||
|
||||
- name: Cleanup old images
|
||||
run: |
|
||||
docker image prune -f
|
||||
run: docker image prune -f
|
||||
|
||||
Reference in New Issue
Block a user