Living the Christian life is not easy, as it requires discipline and self-renunciation. We have to continually deny ourselves in order to live a virtuous life.
However, sometimes we don't always have the best intentions and we try to be virtuous in one area in hopes that people will see how holy we are.
Practicing the hidden virtues
St. Francis de Sales recommends in his Introduction to the Devout Life practicing the hidden virtues as often as we can, instead of those that are "showy":
Among such virtues as have no special adaptation to our own calling, choose the most excellent, not the most showy. A comet generally looks larger than the stars, and fills the eye more; but all the while comets are not nearly so important as the stars, and only seem so large to us because they are nearer to us than stars, and are of a grosser kind. So there are certain virtues which touch us very sensibly and are very material, so to say, and therefore ordinary people give them the preference.
He then explains how it is easy to pick those virtues that are most visible, instead of those that are focused on the interior life:
Thus the common run of men ordinarily value temporal almsgiving more than spiritual; and think more of fasting, exterior discipline and bodily mortification than of meekness, cheerfulness, modesty, and other interior mortifications, which nevertheless are far better. Do you then, my daughter, choose the best virtues, not those which are most highly esteemed; the most excellent, not the most visible; the truest, not the most conspicuous.
This passage from St. Francis de Sales is similar to what Jesus said in the Gospel of Matthew:
But when you give alms, do not let your left hand know what your right is doing, so that your almsgiving may be secret. And your Father who sees in secret will repay you.
Certainly some virtues will involve exterior actions, but we should balance our life with both types of virtues, seeking to do God's will even when no one is watching.