NeuroSAM3 / setup_github_sync.sh
mmrech's picture
Add GitHub Actions workflow and setup script for GitHub-Hugging Face sync
3c0e60a
#!/bin/bash
# Setup script to add GitHub remote and configure dual-push
set -e
echo "πŸ”— Setting up GitHub remote and dual-push configuration..."
echo ""
# Check if GitHub URL is provided
if [ -z "$1" ]; then
echo "Usage: ./setup_github_sync.sh <github_repo_url>"
echo "Example: ./setup_github_sync.sh https://github.com/username/NeuroSAM3.git"
exit 1
fi
GITHUB_URL=$1
# Add GitHub remote
echo "πŸ“¦ Adding GitHub remote..."
git remote add github "$GITHUB_URL" 2>/dev/null || git remote set-url github "$GITHUB_URL"
echo "βœ… GitHub remote added: $GITHUB_URL"
# Show current remotes
echo ""
echo "πŸ“‹ Current remotes:"
git remote -v
# Create git hook for automatic dual-push (optional)
echo ""
echo "πŸ’‘ To push to both remotes automatically, use:"
echo " git push origin main && git push github main"
echo ""
echo " Or set up an alias:"
echo " git config alias.pushall '!git push origin main && git push github main'"
echo " Then use: git pushall"
echo ""
echo "βœ… Setup complete!"
echo ""
echo "πŸ“ Next steps:"
echo " 1. Push to GitHub: git push github main"
echo " 2. Set up GitHub Actions secret:"
echo " - Go to: https://github.com/YOUR_USERNAME/NeuroSAM3/settings/secrets/actions"
echo " - Add secret: HF_TOKEN = your_huggingface_token"
echo " 3. GitHub Actions will automatically sync to Hugging Face on every push"