Theme breaks after deployment. I get white blank page

Im using bedrock with custom deployment using php deployer tool: https://deployer.org

It just copies entirety of code over and creates a symlink. (very typical for PHP projects, atomic and works very well for other projects):

current -> /var/www/sunrise/releases/29/
releases
  25/
  26/
  27/
  28/
  29/

With WP - Everything works fine expect for theme. After deployment I always arrive at the broken site -white screen in frontend, and in admin it says “The active theme is broken. Reverting to the default theme.”. I have to go to admin and point it to my custom theme - after which site works as expected.

Looks like WordPress does some theme paths autodetection - and stores absolute theme path in database:

   option_id: 694
 option_name: template_root
option_value: /var/www/sunrise/releases/29/bedrock/web/wp/wp-content/themes
    autoload: yes
*************************** 128. row ***************************
   option_id: 695
 option_name: stylesheet_root
option_value: /themes
    autoload: yes

^ This breaks on next deploy, as path would be /var/www/sunrise/releases/30 etc.
How would I fix that ? Is there some config param I should set? or do I need to update database on every deploy with new deploy path?
Or - does anyone know how trellis solves this issue?

I solved my issue by using wp cli to set theme path on every deploy:

docker exec sunrise-wp wp --allow-root --quiet --path=/var/www/sunrise/current/bedrock/web/wp option set template_root {{release_path}}/bedrock/web/wp/wp-content/themes

^tested and works