Chat / .github /workflows /sync_to_hf.yml
Sada10's picture
Update and rename deploy.yml to sync_to_hf.yml
9201808 unverified
raw
history blame
1.26 kB
name: Sync to Hugging Face Hub
on:
push:
branches: [main] # یا master اگر برنچ اصلی شما master است
# برای اجرای دستی اکشن از تب Actions
workflow_dispatch:
jobs:
sync-to-hub:
runs-on: ubuntu-latest
steps:
- name: Checkout local repository
uses: actions/checkout@v3
with:
fetch-depth: 0
lfs: true
- name: Push to Hugging Face Space
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
# تنظیمات گیت
git config --global user.email "action@github.com"
git config --global user.name "GitHub Action"
# اضافه کردن ریموت هاگینگ فیس
# فرمت: https://USERNAME:TOKEN@huggingface.co/spaces/USERNAME/SPACE_NAME
# فرض بر این است که نام کاربری opera8 و نام اسپیس chat است
# اگر نام اسپیس شما چیز دیگری است، قسمت آخر آدرس زیر را تغییر دهید
git remote add space https://opera8:$HF_TOKEN@huggingface.co/spaces/opera8/chat
# فورس پوش کردن به اسپیس
git push --force space main