App update issue/helpdesk

In our self-hosted Frappe Helpdesk setup, we make front-end changes in the local development environment and push them to GitLab. On the staging server, we pull the latest changes to reflect them. However, when running bench build and bench migrate, we face an internal server error and cannot submit tickets. The only way we get front-end changes to reflect is by uninstalling, and reinstalling the app, but this results in ticket data loss. What is the correct way to update the staging server without losing data?