Skip to content

Commit 0f96155

Browse files
committed
fix:github_actions
1 parent ea00d13 commit 0f96155

File tree

1 file changed

+19
-21
lines changed

1 file changed

+19
-21
lines changed

.github/workflows/update_space.yml

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,26 @@
1-
name: Run Python script
1+
name: Deploy to Hugging Face Spaces
22

33
on:
44
push:
5-
branches:
6-
- main
5+
branches: [main]
76

87
jobs:
9-
build:
8+
deploy:
109
runs-on: ubuntu-latest
11-
1210
steps:
13-
- name: Checkout
14-
uses: actions/checkout@v2
15-
16-
- name: Set up Python
17-
uses: actions/setup-python@v2
18-
with:
19-
python-version: '3.12.8'
20-
21-
- name: Install Gradio
22-
run: python -m pip install gradio
23-
24-
- name: Log in to Hugging Face
25-
run: python -c 'import huggingface_hub; huggingface_hub.login(token="${{ secrets.hf_token }}")'
26-
27-
- name: Deploy to Spaces
28-
run: gradio deploy
11+
- uses: actions/checkout@v3
12+
- name: Set up Python
13+
uses: actions/setup-python@v4
14+
with:
15+
python-version: '3.12.8'
16+
- name: Install dependencies
17+
run: |
18+
python -m pip install --upgrade pip
19+
pip install huggingface_hub gradio
20+
- name: Login to Hugging Face
21+
run: |
22+
echo ${{ secrets.HF_TOKEN }} | huggingface-cli login
23+
- name: Deploy to Spaces
24+
run: |
25+
# Use --yes to automatically accept prompts
26+
gradio deploy --yes

0 commit comments

Comments
 (0)