File size: 1,174 Bytes
6c02352
 
a5fbe75
 
 
 
 
 
 
 
 
6c02352
a5fbe75
 
 
 
 
 
 
6c02352
a5fbe75
 
 
6c02352
 
a5fbe75
 
 
6c02352
 
a5fbe75
 
 
6c02352
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
# Push hf-space/ to Hugging Face Spaces.
# Usage: $env:HF_TOKEN = "hf_..."; .\backend\scripts\deploy_hf_space.ps1

param(
    [string]$Token = $env:HF_TOKEN,
    [string]$SpaceRepo = "Behrang987/Report-Genius"
)

$ErrorActionPreference = "Stop"
$RepoRoot = Split-Path (Split-Path $PSScriptRoot -Parent) -Parent
$SpaceDir = Join-Path $RepoRoot "hf-space"
& (Join-Path $RepoRoot "backend\scripts\sync_hf_space.ps1")

if (-not $Token) {
    Write-Host "HF write token required. Set `$env:HF_TOKEN or pass -Token."
    exit 1
}

Set-Location $SpaceDir
if (-not (Test-Path ".git")) { git init; git branch -M main }

$remoteUrl = "https://Behrang987:$Token@huggingface.co/spaces/$SpaceRepo"
$remotes = @(git remote 2>$null)
if ($remotes -contains "origin") { git remote set-url origin $remoteUrl }
else { git remote add origin $remoteUrl }

git add Dockerfile README.md .dockerignore backend frontend
$status = git status --porcelain
if ($status) {
    git commit -m "Deploy RICS v2 (senior baseline, CPU Spaces Dockerfile)"
}
Write-Host "Pushing to huggingface.co/spaces/$SpaceRepo ..."
git push -u origin main --force
Write-Host "Done: https://huggingface.co/spaces/$SpaceRepo"