As I said, I appreciate the technic. It’s always good to have tools like that to validate your work.
I empathise with some of the issues you mentioned.
We have a similar git command to check for migrations since the last release. If there are no migrations deploy is easy as nginx reload. If there are, it’s a whole different ball game.
We also encountered locking issues with adding not null field (we found out the hard way…).
If the purpose is to slowly roll out new code I remember reading about deploying to a canary instace that runs on a replicated DB (I think it was on the Instagram engeniring blog). This sounds simpler.
The approach you describe somewhat avoid the issue by enforcing harsh restrictions on the development.