Spaces:
Running
Running
File size: 1,319 Bytes
d42ed51 8ca285d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
#!/bin/bash
# Deploy script - pushes to both GitHub and Hugging Face
# Usage: ./scripts/deploy.sh [commit_message]
set -e # Exit on any error
echo "π Deploying to GitHub and Hugging Face..."
# Get commit message from argument or use default
if [ -n "$1" ]; then
commit_msg="$1"
else
commit_msg="feat: Deploy latest changes"
fi
# Check if there are changes to commit
if git diff --quiet && git diff --cached --quiet; then
echo "βΉοΈ No changes to commit"
else
echo "π Committing changes: $commit_msg"
git add -A
git commit -m "$commit_msg"
fi
# Push to GitHub
echo "π€ Pushing to GitHub..."
if git push origin main; then
echo "β
Successfully pushed to GitHub"
else
echo "β Failed to push to GitHub"
exit 1
fi
# Push to Hugging Face
echo "π€ Pushing to Hugging Face..."
if git push hf main; then
echo "β
Successfully deployed to Hugging Face!"
echo "π Check deployment at: https://huggingface.co/spaces/colin730/SummarizerApp"
echo "β±οΈ Build time: ~5-10 minutes"
echo ""
echo "π― Monitor deployment with:"
echo " curl -s https://colin730-summarizerapp.hf.space/health"
else
echo "β Failed to push to Hugging Face"
exit 1
fi
echo ""
echo "π Deployment complete! Both GitHub and Hugging Face are updated."
|