It seems to me that gradle builds can only fail at publish stage since the default command uses an unexisting init script outside of the project. The default command used is :
./gradlew deploy -I ../deploy.gradle
By activating --debug and --stacktrace in Settings -> Publish -> Run default commands, I could see that the file didn't exist
The specified initialization script '/home/jitpack/build/deploy.gradle' does not exist.