The docs say:
At deployment, before starting your application, you can perform a custom build step by adding a gcp-build script in your package.json file.
"At deployment" makes me think it runs it when you run gcloud app deploy
- but some of the rest of the page makes it sound like it's run when each instance is started.