-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (43 loc) · 1.13 KB
/
deploy-to-hf.yml
File metadata and controls
54 lines (43 loc) · 1.13 KB
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
name: Deploy to Hugging Face Space
on:
push:
branches:
- main
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 1
lfs: false
- name: Prepare clean HF deploy branch without assets
run: |
git config user.email "ci@github.actions"
git config user.name "github-actions[bot]"
original_readme="$(cat README.md)"
cat > README.md <<EOF
---
title: AI Agent
emoji: 🤖
colorFrom: blue
colorTo: green
sdk: docker
app_port: 7860
pinned: false
---
$original_readme
EOF
rm -rf assets
git checkout --orphan hf-deploy
git add -A
git commit -m "Deploy to Hugging Face Space"
- name: Push to HF Space
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
git push --force \
https://SDSC:${HF_TOKEN}@huggingface.co/spaces/SDSC/ai-agent \
hf-deploy:main