Spaces:
Running
Running
| name: Sync to Hugging Face Spaces | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Push to HF (Clean History) | |
| env: | |
| HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
| run: | | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| git config --global user.name "github-actions[bot]" | |
| # Prepare a clean directory for HF (avoiding .git history) | |
| mkdir -p ../hf_space | |
| cp -R . ../hf_space/ | |
| cd ../hf_space | |
| rm -rf .git | |
| # Initialize new repo for HF Space (Stateless) | |
| git init -b main | |
| git add . | |
| git commit -m "deploy: sync to hugging face" | |
| # Force push to HF Space | |
| git remote add space https://winterandchaiyun:$HF_TOKEN@huggingface.co/spaces/winterandchaiyun/quicktools | |
| git push --force space main | |