File size: 1,592 Bytes
26f8b9a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Simple V2 Deployment Script
Write-Host "Deploying V2 to HuggingFace Space..." -ForegroundColor Cyan

$SPACE_URL = "https://huggingface.co/spaces/Xernive/game-asset-generator-pipeline"
$SPACE_DIR = "game-asset-generator-pipeline"
$SOURCE_DIR = "huggingface-space-v2"

# Clone or update Space
if (Test-Path $SPACE_DIR) {
    Write-Host "Updating existing Space..." -ForegroundColor Yellow
    Set-Location $SPACE_DIR
    git pull
    Set-Location ..
} else {
    Write-Host "Cloning Space..." -ForegroundColor Gray
    git clone $SPACE_URL
}

# Clean and copy files
Write-Host "Copying files..." -ForegroundColor Gray
Get-ChildItem $SPACE_DIR -Exclude ".git" | Remove-Item -Recurse -Force

Copy-Item "$SOURCE_DIR/app.py" "$SPACE_DIR/" -Force
Copy-Item "$SOURCE_DIR/requirements.txt" "$SPACE_DIR/" -Force
Copy-Item "$SOURCE_DIR/Dockerfile" "$SPACE_DIR/" -Force
Copy-Item "$SOURCE_DIR/.gitignore" "$SPACE_DIR/" -Force
Copy-Item "$SOURCE_DIR/README.md" "$SPACE_DIR/" -Force

Copy-Item "$SOURCE_DIR/core" "$SPACE_DIR/" -Recurse -Force
Copy-Item "$SOURCE_DIR/generators" "$SPACE_DIR/" -Recurse -Force
Copy-Item "$SOURCE_DIR/processors" "$SPACE_DIR/" -Recurse -Force
Copy-Item "$SOURCE_DIR/utils" "$SPACE_DIR/" -Recurse -Force
Copy-Item "$SOURCE_DIR/scripts" "$SPACE_DIR/" -Recurse -Force

# Commit and push
Write-Host "Pushing to HuggingFace..." -ForegroundColor Green
Set-Location $SPACE_DIR

git add .
git commit -m "Deploy V2 with api_name fix"
git push --force

Set-Location ..

Write-Host "Deployment complete!" -ForegroundColor Green
Write-Host "Space URL: $SPACE_URL" -ForegroundColor Cyan