78 lines
2.5 KiB
YAML
78 lines
2.5 KiB
YAML
name: Deploy to Windows VPS
|
||
|
||
on:
|
||
push:
|
||
branches:
|
||
- main
|
||
workflow_dispatch: # Ermöglicht manuelles Triggern
|
||
|
||
jobs:
|
||
deploy:
|
||
runs-on: windows-latest
|
||
|
||
steps:
|
||
- name: Checkout Code
|
||
uses: actions/checkout@v4
|
||
with:
|
||
fetch-depth: 0
|
||
|
||
- name: Deploy to VPS
|
||
shell: powershell
|
||
run: |
|
||
Write-Host "Starting deployment..." -ForegroundColor Green
|
||
|
||
# Navigiere zum Deployment-Verzeichnis
|
||
Set-Location "C:\TradingBot\placeorder"
|
||
|
||
# Git Pull (neueste Änderungen holen)
|
||
Write-Host "Pulling latest changes from Git..." -ForegroundColor Cyan
|
||
git pull origin main
|
||
|
||
# Optional: Python Dependencies aktualisieren
|
||
Write-Host "Updating Python dependencies..." -ForegroundColor Cyan
|
||
pip install --upgrade -r requirements.txt -ErrorAction SilentlyContinue
|
||
|
||
# Deployment-Skript ausführen
|
||
Write-Host "Running deployment script..." -ForegroundColor Cyan
|
||
.\deploy.ps1
|
||
|
||
Write-Host "Deployment completed successfully!" -ForegroundColor Green
|
||
|
||
- name: Verify Deployment
|
||
shell: powershell
|
||
run: |
|
||
Write-Host "Verifying deployment..." -ForegroundColor Yellow
|
||
|
||
# Prüfe ob Trading Bot Dateien existieren
|
||
$files = @(
|
||
"C:\TradingBot\placeorder\TradingBot_V1.6_Adaptive_Complete_CORRECTED.ipynb",
|
||
"C:\TradingBot\placeorder\trading_dashboard.py",
|
||
"C:\TradingBot\placeorder\trading_database.py"
|
||
)
|
||
|
||
foreach ($file in $files) {
|
||
if (Test-Path $file) {
|
||
Write-Host "✓ $file exists" -ForegroundColor Green
|
||
} else {
|
||
Write-Host "✗ $file missing!" -ForegroundColor Red
|
||
exit 1
|
||
}
|
||
}
|
||
|
||
Write-Host "All files verified!" -ForegroundColor Green
|
||
|
||
- name: Restart Services
|
||
shell: powershell
|
||
run: |
|
||
Write-Host "Restarting services..." -ForegroundColor Cyan
|
||
|
||
# Restart Trading Dashboard Service (falls als Service läuft)
|
||
if (Get-Service -Name "TradingDashboard" -ErrorAction SilentlyContinue) {
|
||
Restart-Service -Name "TradingDashboard" -Force
|
||
Write-Host "✓ TradingDashboard service restarted" -ForegroundColor Green
|
||
} else {
|
||
Write-Host "ℹ TradingDashboard service not found (might not be installed yet)" -ForegroundColor Yellow
|
||
}
|
||
|
||
Write-Host "Deployment process finished!" -ForegroundColor Green
|