name: Manual and Auto Sync to Hugging Face on: workflow_dispatch: jobs: sync-dataset: runs-on: ubuntu-latest steps: - name: Checkout Repository uses: actions/checkout@v4 with: fetch-depth: 1 - name: Push Clean History to Hugging Face env: HF_TOKEN: ${{ secrets.HF_TOKEN }} run: | # 1. Delete the Git history so old large files are completely forgotten rm -rf .git # 2. Clean up any random .exe files just in case they were generated during a build find . -name "*.exe" -type f -delete || true # 3. Initialize a brand new, empty Git repository git init git checkout -b main # 4. Set up bot credentials git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" # 5. Initialize Git LFS and track binary files so Hugging Face accepts them git lfs install git lfs track "*.pdf" git lfs track "*.docx" git add .gitattributes # 6. Add only the CURRENT files and make a single fresh commit git add . git commit -m "Auto-sync latest raw files to Hugging Face" # 7. Force push this single commit to Hugging Face, overwriting everything git push --force https://notamitgamer:$HF_TOKEN@huggingface.co/datasets/notamitgamer/usercontent main:main