# Docker Build and Push Script for Prayer App # Run this script to build and push the Docker container to GitHub Container Registry Write-Host "🔨 Building Docker image..." -ForegroundColor Green docker build -t ghcr.io/nmemmert/prayer-app:latest . if ($LASTEXITCODE -eq 0) { Write-Host "✅ Docker image built successfully!" -ForegroundColor Green Write-Host "🔐 Logging into GitHub Container Registry..." -ForegroundColor Yellow Write-Host "Please enter your GitHub Personal Access Token (with package write permissions):" -ForegroundColor Yellow $token = Read-Host -AsSecureString $tokenPlain = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($token)) echo $tokenPlain | docker login ghcr.io -u nmemmert --password-stdin if ($LASTEXITCODE -eq 0) { Write-Host "🚀 Pushing Docker image to GitHub Container Registry..." -ForegroundColor Green docker push ghcr.io/nmemmert/prayer-app:latest if ($LASTEXITCODE -eq 0) { Write-Host "✅ Docker image pushed successfully!" -ForegroundColor Green Write-Host "🌐 Your container is now available at: ghcr.io/nmemmert/prayer-app:latest" -ForegroundColor Cyan } else { Write-Host "❌ Failed to push Docker image" -ForegroundColor Red } } else { Write-Host "❌ Failed to login to GitHub Container Registry" -ForegroundColor Red } } else { Write-Host "❌ Failed to build Docker image" -ForegroundColor Red }