talk2data / .github /workflows /sync_with_hf.yml
cevheri's picture
Update sync_with_hf.yml
7176af1
name: Sync to Hugging Face Hub
on:
push:
branches: [demo-tmp-memory]
jobs:
sync-to-hub:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
lfs: true
- name: Clean binary files from history
run: |
git filter-branch --force --index-filter \
"git rm --cached --ignore-unmatch exports/charts/blank_chart.png resources/visualization_demo.png" \
--prune-empty --tag-name-filter cat -- --all
git reflog expire --expire=now --all
git gc --prune=now --aggressive
- name: Push to HF Space
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
HF_ORGANIZATION: ${{ vars.HF_ORGANIZATION }}
HF_SPACE: ${{ vars.HF_SPACE }}
run: |
git config --global user.email "actions@github.com"
git config --global user.name "GitHub Actions"
git remote add hf "https://api:$HF_TOKEN@huggingface.co/spaces/$HF_ORGANIZATION/$HF_SPACE"
git fetch hf
git checkout demo-tmp-memory
git push hf demo-tmp-memory:main --force
# - name: Push to HF Gradio App
# env:
# HF_TOKEN: ${{ secrets.HF_TOKEN }}
# HF_ORGANIZATION: ${{ vars.HF_ORGANIZATION }}
# HF_SPACE: ${{ vars.HF_SPACE }}
# run: |
# git config --global user.email "actions@github.com"
# git config --global user.name "GitHub Actions"
# git remote add hf2 "https://api:$HF_TOKEN@huggingface.co/spaces/intellica/lokum"
# git fetch hf2
# git checkout demo-tmp-memory
# git push hf2 demo-tmp-memory:main --force