Process definition versioning

Hi,
Is there a way to manage process definition versioning? (SpringBoot/Flowable 6.6.0)
My goal is to prevent versioning when the process definition didn’t change (as the app is on the cloud and pods are often restarting w/o any change in the process definition).
My idea was to manage in the code a version ID and at each bootstrap, check which version is installed and if necessary load the new version.
Thank you.

latestInDb =  repositoryService.createDeploymentQuery().deploymentTenantId(xxx).latest()
   
if(not Latest...)
repositoryService.createDeployment()
                .tenantId(xxx)
                .addClasspathResource(myXML)
                .deploy();

Any ideas regarding the versioning?
Thanks!