Configure gitlab ci so it only deploys configuration file if no other code changes were made?

Currently our deployments are being done automatically when a commit is done to the master branch via gitlab ci. We deploy two things, a war and a configuration file for each repo, the config file is in the same repo as the code that builds the war.

I'd like to change this logic so that if I make a commit that only changes the configuration file then only the configuration file will be deployed, ie don't re-deploy a war if the code for the war hasn't been modified.

Is there a clean way to update our gliab-ci so it can determine rather to deploy war, config file, or both based off of files changed?