Deployment Guide
HuggingFace Spaces Deployment
Your Space is live at: https://huggingface.co/spaces/Chunte/Thumbnail_miniCrafter
Quick Deploy
Windows:
Simply run the batch file:
deploy-hf.bat
Mac/Linux:
Use npm script:
npm run deploy:hf
What the Script Does
- Builds production bundle (
npm run build) - Creates deployment branch (
hf-deploy) - Moves
dist/contents to root - Commits changes
- Pushes to HuggingFace Spaces
- Returns to main branch
Manual Deployment (Alternative)
If you prefer manual control:
# 1. Build
npx vite build
# 2. Create deployment branch
git checkout -b hf-deploy
# 3. Move dist contents to root
# (Windows)
xcopy /E /Y dist\* .
rd /s /q dist
# 4. Copy README
git checkout main -- README.md
# 5. Commit and push
git add -A
git commit -m "Deploy to HF Spaces"
git push huggingface hf-deploy:main --force
# 6. Return to main
git checkout main
First-Time Setup (Already Done!)
✅ Git remote added:
git remote add huggingface https://huggingface.co/spaces/Chunte/Thumbnail_miniCrafter
Authentication
If you get authentication errors:
Generate HuggingFace Token:
- Go to https://huggingface.co/settings/tokens
- Create a new token with "write" access
- Copy the token
Configure Git Credential Helper:
git config credential.helper storeOn next push, enter:
- Username:
Chunte - Password:
[your token]
- Username:
Workflow for Updates
- Make changes in your code
- Test locally:
npm run dev - Commit to GitHub:
git add . && git commit -m "..." && git push - Deploy to HF Spaces:
deploy-hf.bat(ornpm run deploy:hf) - Done! Changes live in ~30 seconds
Troubleshooting
Build Fails
# Clean and rebuild
rm -rf dist node_modules
npm install
npx vite build
Push Fails
# Check remotes
git remote -v
# Force push if needed
git push huggingface hf-deploy:main --force
Branch Issues
# Delete local deployment branch
git branch -D hf-deploy
# Start fresh
deploy-hf.bat
Notes
- The
hf-deploybranch contains only built files (fromdist/) - Your main branch remains unchanged with source code
- GitHub repo and HF Spaces are separate (both get updates)
- HF Spaces updates in real-time when you push
🚀 Happy deploying!