-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.ps1
More file actions
48 lines (38 loc) · 1.27 KB
/
deploy.ps1
File metadata and controls
48 lines (38 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Deploy script - Add, Commit and Push
# Usage: .\deploy.ps1
Write-Host "🚀 Starting deployment process..." -ForegroundColor Green
# Add all changes
Write-Host "📁 Adding all files..." -ForegroundColor Yellow
git add .
git add .
# Check if there are changes to commit
$status = git status --porcelain
if (-not $status) {
Write-Host "✅ No changes to commit." -ForegroundColor Green
exit 0
}
# Show what will be committed
Write-Host "📝 Files to be committed:" -ForegroundColor Cyan
git status --short
# Commit with timestamp
$timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
$commitMessage = "Update: $timestamp"
Write-Host "💾 Committing changes..." -ForegroundColor Yellow
git commit -m $commitMessage
# Check if commit was successful
if ($LASTEXITCODE -eq 0) {
Write-Host "✅ Commit successful!" -ForegroundColor Green
# Push to remote
Write-Host "🌐 Pushing to remote..." -ForegroundColor Yellow
git push
if ($LASTEXITCODE -eq 0) {
Write-Host "🎉 Deploy completed successfully!" -ForegroundColor Green
} else {
Write-Host "❌ Push failed!" -ForegroundColor Red
exit 1
}
} else {
Write-Host "❌ Commit failed!" -ForegroundColor Red
exit 1
}
Write-Host "✨ All done!" -ForegroundColor Green