diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f49f4e7..1681232 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,7 +17,7 @@ jobs: - name: Wait for containers to start run: sleep 60 # 1 Minute - - name: Check container statuses + - name: Check container statuses and logs run: | services=("prometheus" "grafana" "exporter" "postgres") @@ -27,6 +27,7 @@ jobs: if [ -z "$container_id" ]; then echo "Error: Container for $service not found" + docker-compose logs $service exit 1 fi @@ -35,11 +36,15 @@ jobs: if [ "$status" != "running" ]; then echo "Error: Container $service ($container_id) is not running. Current status: $status" + echo "Last logs for $service:" + docker-compose logs --tail=50 $service exit 1 fi if [ "$restarts" -gt 0 ]; then echo "Error: Container $service ($container_id) has restarted $restarts times" + echo "Last logs for $service:" + docker-compose logs --tail=50 $service exit 1 fi