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
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Create .env.production
|
- name: Pull latest code
|
||||||
run: |
|
run: |
|
||||||
cat > .env.production << 'ENVEOF'
|
cd /home/three/startover/repo
|
||||||
DB_USER=${{ secrets.DB_USER }}
|
git fetch origin
|
||||||
DB_PASSWORD=${{ secrets.DB_PASSWORD }}
|
git reset --hard origin/main
|
||||||
DB_NAME=${{ secrets.DB_NAME }}
|
echo "Current commit: $(git log --oneline -1)"
|
||||||
REDIS_PASSWORD=${{ secrets.REDIS_PASSWORD }}
|
|
||||||
NEXTAUTH_URL=${{ secrets.NEXTAUTH_URL }}
|
- name: Copy environment file
|
||||||
NEXTAUTH_SECRET=${{ secrets.NEXTAUTH_SECRET }}
|
run: |
|
||||||
ENVEOF
|
cp /home/three/startover/.env.production /home/three/startover/repo/.env.production
|
||||||
|
|
||||||
- name: Build and Deploy
|
- name: Build and Deploy
|
||||||
run: |
|
run: |
|
||||||
|
cd /home/three/startover/repo
|
||||||
docker compose -f docker-compose.prod.yml --env-file .env.production up -d --build --remove-orphans
|
docker compose -f docker-compose.prod.yml --env-file .env.production up -d --build --remove-orphans
|
||||||
|
|
||||||
- name: Run database migrations
|
- name: Wait for services
|
||||||
run: |
|
run: sleep 15
|
||||||
docker compose -f docker-compose.prod.yml exec -T web sh -c "cd /app && npx prisma migrate deploy" || echo "Migration skipped (first deploy)"
|
|
||||||
|
|
||||||
- name: Health check
|
- name: Health check
|
||||||
run: |
|
run: |
|
||||||
echo "Waiting for services to start..."
|
if curl -sf http://localhost/health > /dev/null 2>&1; then
|
||||||
sleep 10
|
echo "Health check PASSED"
|
||||||
curl -f http://localhost/health || echo "Health check pending - services may still be starting"
|
else
|
||||||
|
echo "WARNING: Health check pending"
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Cleanup old images
|
- name: Cleanup old images
|
||||||
run: |
|
run: docker image prune -f
|
||||||
docker image prune -f
|
|
||||||
|
|||||||
Reference in New Issue
Block a user