File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 9191 env :
9292 VPS_IP : ${{ secrets.VPS_IP }}
9393 run : |
94- health_status=$(sshpass -p "${{ secrets.SSH_PASSPHRASE }}" ssh -o StrictHostKeyChecking=no docker@${VPS_IP} "docker inspect --format '{{json .State.Health.Status}}' $(docker ps -q -f name=api)")
94+ health_status=$(sshpass -p "${{ secrets.SSH_PASSPHRASE }}" ssh -o StrictHostKeyChecking=no docker@${VPS_IP} << 'EOF'
95+ container_id=$(docker ps -q -f name=api)
96+ if [ -z "$container_id" ]; then
97+ echo "No container found with name 'api'."
98+ exit 1
99+ else
100+ docker inspect --format '{{json .State.Health.Status}}' "$container_id"
101+ fi
102+ EOF
103+ )
95104 if [[ "$health_status" != "\"healthy\"" ]]; then
96105 echo "API container is unhealthy! Status: $health_status"
97106 exit 1
You can’t perform that action at this time.
0 commit comments