name: Deploy to Hugging Face on: push: branches: [main] workflow_dispatch: jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: fetch-depth: 0 # ← THIS IS THE CRITICAL FIX - name: Setup Git run: | git config --global user.name "github-actions" git config --global user.email "github-actions@github.com" - name: Deploy to Hugging Face run: | # Add Hugging Face remote with token authentication git remote add huggingface https://${{ secrets.HF_USERNAME }}:${{ secrets.HF_TOKEN }}@huggingface.co/spaces/${{ secrets.HF_USERNAME }}/ci-cd-anomaly-detection # Push to Hugging Face with full history git push huggingface main --force