Worldshaper/scripts/deploy-vps.ps1

32 lines
586 B
PowerShell
Raw Permalink Normal View History

2026-06-26 18:18:14 -04:00
param(
2026-06-27 00:40:45 -04:00
[string]$Remote = "origin",
2026-06-26 18:18:14 -04:00
[string]$Branch = ""
)
$ErrorActionPreference = "Stop"
function Step($message) {
Write-Host ""
Write-Host "==> $message" -ForegroundColor Cyan
}
if (-not $Branch) {
$Branch = (git branch --show-current).Trim()
}
if (-not $Branch) {
throw "Could not determine the current git branch. Pass -Branch explicitly."
}
Step "Validating content"
npm run validate:content
Step "Building project"
npm run build
Step "Pushing $Branch to $Remote"
git push $Remote $Branch
Write-Host ""
Write-Host "Deploy push complete." -ForegroundColor Green