For, brethren, ye heard just now when the Gospel was read, at least if ye had for it the ear not only of the body but also of the heart. What said it? “Take heed that ye do not your righteousness before men, to be seen of them.” (Matthew 6:1) Did He mean to say this, that whatever good things we do, we should hide them from the eyes of men, and fear to be seen? If thou fearest spectators thou wilt not have imitators: thou oughtest therefore to be seen. But thou must not do it to the end thou mayest be seen. Not there should be the end of thy joy, not there the goal of thy rejoicing, that thou shouldest account thyself to have gotten the whole fruit of thy good work, when thou art seen and praised. This is nothing. Despise thyself when thou art praised, let Him be praised in thee who worketh by thee. Therefore do not for thine own praise work the good thou doest: but to the praise of Him from whom thou hast the power to do good. From thy self thou hast the ill doing, from God thou hast the well doing...
Source: Homilies on the First Epistle of John, IV, 2