Sometimes, gatsby build process is stuck at source and transform nodes phase or may be at createPages etc. There is a very weird fix to it.
Trust me, this is going to sound very weird, but it works.
Just resize the terminal the window, the build process should resume.