cxr-report-generation / deploy_hf.sh
adhisetiawan's picture
Sync latest application changes
21245a4
Raw
History Blame Contribute Delete
1.39 kB
#!/usr/bin/env bash
set -euo pipefail
SOURCE_DIR="/home/adhi/Documents/projects/elvasoft-ai-demo"
HF_SPACE_DIR="/home/adhi/Documents/projects/cxr-report-generation"
echo "========================================"
echo " Syncing project to Hugging Face Space"
echo "========================================"
rsync -av \
--exclude='.git' \
--exclude='.venv' \
--exclude='__pycache__' \
--exclude='*.pyc' \
--exclude='.idea' \
--exclude='.vscode' \
--exclude='README.md' \
--exclude='outputs/' \
--exclude='work_dir/' \
--exclude='source/quick_start_with_hugging_face-2.ipynb' \
"${SOURCE_DIR}/" \
"${HF_SPACE_DIR}/"
echo
echo "========================================"
echo " Git status"
echo "========================================"
cd "${HF_SPACE_DIR}"
git status
if git diff --quiet && git diff --cached --quiet; then
echo
echo "No changes to deploy."
exit 0
fi
echo
echo "========================================"
echo " Committing deployment"
echo "========================================"
git add .
git commit -m "Sync latest application changes"
echo
echo "========================================"
echo " Pushing to Hugging Face Space"
echo "========================================"
git push origin main
echo
echo "========================================"
echo " Deployment completed"
echo "========================================"