Worldshaper/scripts/deploy-vps.ps1

31 lines
586 B
PowerShell

param(
[string]$Remote = "origin",
[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