Automated deployment with content migrations and structural changes In the knowledge base article there are 4 steps described to automate the deployment process

Pull updates for git
Run composer install
Run migrate/all
Run project-config/apply

The problem with this is that when you have pushed a structural change (eg. adding a new field) and a content migration (adding new entry using that new field) at the same time, it fails because you cannot migrate into a non existing field of course
You cannot flip step 3 and 4 as in that scenario changes made to Craft CMS are not yet available in the database.
Something I wish I knew a long time ago, as it has bitten us quite a few times already in the past. Nothing as bad as having an automated deployment process that fails once in a while.
I'm sharing it here, but I believe it would be good to add it to the knowledge base too (https://craftcms.com/knowledge-base/deployment-best-practices)
The solution is to split up the structural migration and the content migration.
Pull the update for git and then run
craft update/composer-install --interactive=0
craft migrate/all --no-content --interactive=0
craft project-config/apply --force
craft migrate --track=content --interactive=0

Pretty straightforward and simple, but I was not aware of the --no-content flag until recently as it not in the command help.  I hope it will help somebody in the future!
(The --interactive=0 and --force flags are there because it is an unattended deploy)