Spaces:
Sleeping
Sleeping
| name: Deploy to HF Space | |
| on: | |
| push: | |
| branches: [main] | |
| paths-ignore: | |
| - '**.md' | |
| - 'docs/**' | |
| - 'frontend/**' # Frontend builds on HF Space | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Push to HF Space | |
| run: | | |
| pip install -U huggingface_hub | |
| python -c "from huggingface_hub import HfApi; api = HfApi(token='${{ secrets.HF_TOKEN }}'); api.upload_folder(folder_path='.', repo_id='nice-bill/agent-arena', repo_type='space', commit_message='deploy from github')" | |
| - name: Restart HF Space to rebuild frontend | |
| run: | | |
| curl -X POST "https://nice-bill-agent-arena.hf.space/api/restart" \ | |
| -H "Content-Type: application/json" | |
| - name: Verify new version | |
| run: | | |
| sleep 15 | |
| curl -s "https://nice-bill-agent-arena.hf.space/api/version" | |