This will use the github_rsa key for repositories hosted at github.com, and the gitlab_rsa key for repositories hosted at gitlab.com. Adjust as needed for your key names and hosts, obviously.
#example gitlab gitconfig from the included path
[user]
name = Your Name
email = [email protected]
signingkey = 0000999988887777
[commit]
gpgsign = true
if all works well, Git should be able to automatically use the selected key depending on the repo's stated remote server.