File size: 1,338 Bytes
8526ac7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0850615
 
 
 
 
 
 
ba1493f
 
701fc06
8b415bc
 
 
f24500a
9ea7e7f
 
8526ac7
 
 
fc1ee1b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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