chest-disease / .github /workflows /sync_to_hf.yml
GitHub Actions Bot
Clean deploy to HF Space
5e1f929
raw
history blame contribute delete
972 Bytes
name: Sync to Hugging Face Space
on:
push:
workflow_dispatch:
permissions:
contents: write
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Configure Git
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "GitHub Actions Bot"
- name: Push clean snapshot to Hugging Face Space (MAIN branch)
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
set -e
echo "πŸš€ Creating clean deploy snapshot"
git checkout --orphan hf-clean
git rm -rf . || true
git checkout main -- .
git add .
git commit -m "Clean deploy to HF Space"
git push https://user:${HF_TOKEN}@huggingface.co/spaces/Arko007/chest-disease hf-clean:main --force
echo "βœ… Deployed to HF Space main branch"