28 lines
764 B
PowerShell
28 lines
764 B
PowerShell
# ReSekai Deploy Script
|
|
# Usage: .\deploy.ps1
|
|
|
|
$SERVER = "root@46.225.108.69"
|
|
$PROJECT_PATH = "/var/www/resekai/ReSekai"
|
|
|
|
Write-Host "Deploying ReSekai to production..." -ForegroundColor Cyan
|
|
|
|
# Build locally first
|
|
Write-Host "`nBuilding frontend..." -ForegroundColor Yellow
|
|
npm run build
|
|
if ($LASTEXITCODE -ne 0) {
|
|
Write-Host "Build failed!" -ForegroundColor Red
|
|
exit 1
|
|
}
|
|
|
|
# Deploy to server
|
|
Write-Host "`nDeploying to server..." -ForegroundColor Yellow
|
|
$CMD = "cd $PROJECT_PATH && git pull && npm run build && cd server && npm install && pm2 restart resekai-api"
|
|
ssh $SERVER $CMD
|
|
|
|
if ($LASTEXITCODE -eq 0) {
|
|
Write-Host "`nDeployment successful!" -ForegroundColor Green
|
|
} else {
|
|
Write-Host "`nDeployment failed!" -ForegroundColor Red
|
|
exit 1
|
|
}
|