Backend gets stuck in deployment

I have a project that gets deployed on an ec2 instance automatically via github actions. But after some recent changes to the code, the deployment takes too long and often gets stuck somewhere in between the deployment process. Mainly it gets stuck at “tsc -p .” and other times anywhere random. I have the logs of github actions here. There is nothing wrong with the compilation in local environment.enter image description here

Could you please guide me on how to debug this or what are the steps I can follow to fix this ?

I tried to fix the typescript compilation that happens with “tsc -p” as it was producing an error. It got resolved for once and the code was deployed with no issues, but then again it started getting stuck while producing no errors whatsoever.
There is no problem with the ec2 instance as well. Can it be the case that my node version is old (16) which is producing problems ?