Skip to content

trigger workflow by modifying backend string #2

trigger workflow by modifying backend string

trigger workflow by modifying backend string #2

Workflow file for this run

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}'
)
"