-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (34 loc) · 854 Bytes
/
Copy pathdeploy-to-hf.yml
File metadata and controls
39 lines (34 loc) · 854 Bytes
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
name: Deploy Backend to Hugging Face
on:
push:
branches:
- main
paths:
- 'backend/**'
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Hugging Face Hub
run: pip install huggingface_hub
- name: Push to Hugging Face
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
python -c "
from huggingface_hub import HfApi
api = HfApi()
api.upload_folder(
folder_path='backend',
repo_id='chinmaygawad/nutrivision-backend',
repo_type='space',
token='${HF_TOKEN}'
)
"