Spaces:
Runtime error
Runtime error
Add GitHub-based deployment script to bypass Railway CLI timeout
Browse files- deploy.ps1 +50 -0
deploy.ps1
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# FireTech Messenger Auto-Deployment Script
|
| 2 |
+
# This script commits and pushes code to GitHub, triggering Railway auto-deploy
|
| 3 |
+
# Usage: .\deploy.ps1 "your commit message"
|
| 4 |
+
|
| 5 |
+
param(
|
| 6 |
+
[string]$Message = "Auto-deploy update"
|
| 7 |
+
)
|
| 8 |
+
|
| 9 |
+
Write-Host "π FireTech Messenger Deployment Handler" -ForegroundColor Cyan
|
| 10 |
+
Write-Host "========================================" -ForegroundColor Cyan
|
| 11 |
+
Write-Host ""
|
| 12 |
+
|
| 13 |
+
# Verify git is available
|
| 14 |
+
$gitExists = git --version 2>$null
|
| 15 |
+
if (-not $gitExists) {
|
| 16 |
+
Write-Host "β Git not found. Please install Git for Windows." -ForegroundColor Red
|
| 17 |
+
exit 1
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
# Check git status
|
| 21 |
+
$status = git status --porcelain
|
| 22 |
+
if ([string]::IsNullOrWhiteSpace($status)) {
|
| 23 |
+
Write-Host "β
No changes to commit. Repository is clean." -ForegroundColor Green
|
| 24 |
+
exit 0
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
Write-Host "π Staging changes..." -ForegroundColor Yellow
|
| 28 |
+
git add -A
|
| 29 |
+
|
| 30 |
+
Write-Host "πΎ Committing with message: '$Message'" -ForegroundColor Yellow
|
| 31 |
+
git commit -m "$Message"
|
| 32 |
+
|
| 33 |
+
if ($LASTEXITCODE -ne 0) {
|
| 34 |
+
Write-Host "β Commit failed." -ForegroundColor Red
|
| 35 |
+
exit 1
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
Write-Host "π€ Pushing to GitHub (triggers Railway auto-deploy)..." -ForegroundColor Yellow
|
| 39 |
+
git push origin main
|
| 40 |
+
|
| 41 |
+
if ($LASTEXITCODE -eq 0) {
|
| 42 |
+
Write-Host "" -ForegroundColor Green
|
| 43 |
+
Write-Host "β
Push successful!" -ForegroundColor Green
|
| 44 |
+
Write-Host "π Railway is now auto-deploying from GitHub..." -ForegroundColor Green
|
| 45 |
+
Write-Host " Check dashboard: https://railway.app/" -ForegroundColor Cyan
|
| 46 |
+
Write-Host "" -ForegroundColor Green
|
| 47 |
+
} else {
|
| 48 |
+
Write-Host "β Push failed. Check your GitHub credentials." -ForegroundColor Red
|
| 49 |
+
exit 1
|
| 50 |
+
}
|