Skip to content

gap analysis quick enrichment fix v1.2 #42

gap analysis quick enrichment fix v1.2

gap analysis quick enrichment fix v1.2 #42

Workflow file for this run

name: Deploy FastAPI to VM
on:
push:
branches: [main]
workflow_dispatch:
jobs:
deploy-fastapi:
runs-on: ubuntu-latest
steps:
- name: Setup SSH key
run: |
mkdir -p ~/.ssh
echo "${{ secrets.VM_SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H 4.247.29.26 >> ~/.ssh/known_hosts
- name: Deploy FastAPI
run: |
ssh seed@4.247.29.26 << 'EOF'
set -e
echo "Deploying FastAPI..."
cd /opt/scholarai/ScholarAI-Backend-FastAPI
echo "Updating ScholarAI-Backend-FastAPI..."
git pull origin main
echo "Stopping FastAPI..."
./scripts/docker.sh stop || true
echo "Building and starting FastAPI..."
./scripts/docker.sh build
./scripts/docker.sh start
echo "FastAPI deployment completed!"
EOF
- name: Health Check
run: |
sleep 30
echo "Running health check for FastAPI..."
if curl -f http://4.247.29.26:8000/health; then
echo " FastAPI is healthy"
else
echo "FastAPI health check failed"
exit 1
fi