File size: 1,122 Bytes
59bd45e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
49
50
51
52
53
54
55
56
57
58
@echo off
echo ========================================
echo 构建并部署到 Hugging Face Spaces
echo ========================================
echo.

echo [1/4] 构建前端...
cd frontend
call npm install
if errorlevel 1 (
    echo 错误: npm install 失败
    pause
    exit /b 1
)

call npm run build
if errorlevel 1 (
    echo 错误: npm run build 失败
    pause
    exit /b 1
)
cd ..

echo.
echo [2/4] 检查构建产物...
if not exist "frontend\dist\index.html" (
    echo 错误: 构建产物不存在
    pause
    exit /b 1
)
echo ✓ 构建产物检查通过

echo.
echo [3/4] 提交到 Git...
git add .
git commit -m "Build: Update frontend dist for deployment"
if errorlevel 1 (
    echo 提示: 没有新的更改需要提交
)

echo.
echo [4/4] 推送到 Hugging Face...
git push hf main
if errorlevel 1 (
    echo 错误: 推送失败
    echo 请检查 Hugging Face 远程仓库配置
    pause
    exit /b 1
)

echo.
echo ========================================
echo ✓ 部署完成!
echo ========================================
echo.
echo 访问你的 Hugging Face Space 查看应用
pause