Extractor_Final / .github /workflows / hf-space-sync.yml
HarshAg1702
hf-space
412df76
Raw
History Blame Contribute Delete
1.17 kB
name: Deploy to Hugging Face Space
on:
push:
branches: [main]
workflow_dispatch:
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true
- name: Push to HF Space
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
# Add the HF remote
git remote add hf https://Tru2025:${HF_TOKEN}@huggingface.co/spaces/Tru2025/Extractor_Final
# Fetch the latest changes from HF
git fetch hf
# Try to merge or rebase (choose one approach)
# Option 1: Merge approach (preserves history)
git merge hf/main --allow-unrelated-histories || git merge hf/main --strategy-option=ours
# Option 2: Force push (overwrites HF space - uncomment if you prefer this)
# git push hf main --force
# Push the merged changes
git push hf main