Sunan Ibn Majah, Book 37, Hadith 127 (Ibn Majah 4230)

It was narrated that Abu Hurairah said:

“A man said: ‘O Messenger of Allah, I do a good deed, then others find out about it and that pleases me.’ He said: ‘You will have two rewards, the reward for doing it in secret and the reward for doing it openly (so that others may follow your example).’”