name: Sync to Hugging Face Space on: push: branches: [ main ] jobs: deploy-to-hf-space: runs-on: ubuntu-latest steps: - name: Checkout Repository uses: actions/checkout@v3 - name: Install Git run: sudo apt-get install git - name: Push to Hugging Face Space env: HF_TOKEN: ${{ secrets.HF_TOKEN }} run: | git config --global user.email "jaishnacodz@gmail.com" git config --global user.name "JaishnaCodz" git clone https://JaishnaCodz:$HF_TOKEN@huggingface.co/spaces/JaishnaCodz/ObjectDetection hf_space rsync -av --exclude='.git' ./ hf_space/ cd hf_space git add . git commit -m "Sync from GitHub" git push