ali4568's picture
πŸš€ Auto-deploy from GitHub Action
6d86f50 verified
name: πŸš€ Deploy to Hugging Face Space
on:
push:
branches:
- master # Trigger on pushes to main branch
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade huggingface_hub
- name: Deploy to Hugging Face Space
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
python - <<'EOF'
import os
from huggingface_hub import upload_folder
repo_id = "ali4568/LawMadad"
print(f"πŸš€ Deploying to Hugging Face Space: {repo_id}")
upload_folder(
folder_path=".", # Upload current folder
repo_id=repo_id,
repo_type="space",
token=os.environ["HF_TOKEN"],
commit_message="πŸš€ Auto-deploy from GitHub Action"
)
print("βœ… Deployment complete!")
EOF