Sub-module build

Hi,

Is there any possible to build sub-modules only when code updated in sub-modules.

Example : git@github.com:Example/samplems.git

I have App1 & App2 in same repo, But I need only when app1 have cahanges app1 only need to build and deploy same as if app2 has code updated app2 only build.