I reckon cache rebuild should happen as the last step in deploy.
Modules can break during a cache rebuild if their new version requires a changed schema (e.g. a new field). So updatedb should be the first step, then config-import, then cache-rebuild.
I might be wrong but just had to update my .platform.app.yaml because an update in a module (commerce_pricelist) caused issues.
I reckon cache rebuild should happen as the last step in deploy. Modules can break during a cache rebuild if their new version requires a changed schema (e.g. a new field). So updatedb should be the first step, then config-import, then cache-rebuild.
I might be wrong but just had to update my .platform.app.yaml because an update in a module (commerce_pricelist) caused issues.