sliitguy
updated for deployment
782bbd9
name: Sync to Hugging Face Space
on:
push:
branches:
- main
- master
workflow_dispatch:
jobs:
sync-to-hub:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true
- name: Setup Git LFS
run: |
git lfs install
git lfs pull
git lfs checkout
- name: Configure Git
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- name: Push to Hugging Face Space
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
HF_USERNAME: nivakaran
HF_SPACE: sparrowagenticai
run: |
git branch -M main
git push https://$HF_USERNAME:$HF_TOKEN@huggingface.co/spaces/$HF_USERNAME/$HF_SPACE main --force
if [ $? -ne 0 ]; then
echo "Push failed - check token and permissions"
exit 1
fi
- name: Verify Sync
if: success()
run: echo "successfully synced to Hugging Face Space!"
- name: Sync Failed
if: failure()
run: echo "Failed to sync to Hugging Face Space. Check logs above."