Spaces:
Sleeping
Sleeping
name: Sync to Hugging Face hub | |
on: | |
push: | |
branches: [main] | |
# to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
sync-to-hub: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
lfs: true | |
- name: Removing sensitive files and their commits from Git history | |
run: git filter-branch --force --index-filter "git rm --cached --ignore-unmatch output_sample.mp4" --prune-empty --tag-name-filter cat -- --all | |
- name: remove these old commits | |
run: git for-each-ref --format="%(refname)" refs/original/ | xargs -I {} git update-ref -d {} | |
- name: garbage collector | |
run: git gc --prune=now && git gc --aggressive --prune=now | |
- name: push the changes | |
env: | |
HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
run: git push --force https://KushwanthK:$HF_TOKEN@huggingface.co/spaces/KushwanthK/streamlit-example main | |
- name: LFS Install | |
run: git lfs install | |
- name: LFS Track | |
run: git lfs track *.mp4 | |
- name: Checkout LFS objects | |
run: git lfs checkout | |
- name: Push to hub | |
env: | |
HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
run: git push --force https://KushwanthK:$HF_TOKEN@huggingface.co/spaces/KushwanthK/streamlit-example main | |