quicktools / deploy.sh
github-actions[bot]
deploy: sync to hugging face
4cb7ab8
raw
history blame contribute delete
797 Bytes
#!/bin/bash
# Safe Deployment Script for VisaBerry / QuickTools
echo "πŸš€ Starting Safe Deployment Process..."
# 1. Run Backend Unit Tests
echo "πŸ§ͺ Running Backend Tests..."
cd backend
if venv/bin/pytest test_main.py; then
echo "βœ… Tests Passed!"
else
echo "❌ Tests Failed! Deployment Aborted."
exit 1
fi
cd ..
# 2. Build Frontend
echo "πŸ—οΈ Building Frontend..."
cd frontend
rm -rf .next
if npm run build; then
echo "βœ… Build Successful!"
else
echo "❌ Build Failed! Deployment Aborted."
exit 1
fi
# 3. Zero-Downtime Reload via PM2
echo "πŸ”„ Reloading Services..."
pm2 reload visa-frontend
# Backend is usually fast, restart is fine, or also reload if using gunicorn
pm2 restart visa-backend
echo "✨ Deployment Complete! VisaBerry is live and stable."