All perfect praise be to Allah, the Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad, sallallahu ʻalayhi wa sallam, is His slave and Messenger.
There is no doubt that what you are doing now – keeping your charity secret – is the basic principle in this regard, because this is more free from Riyaa’ (ostentation; showing off and seeking to impress others in order to win their praise). Allah, the Exalted, says (what means): {If you disclose your charitable expenditures, they are good; but if you conceal them and give them to the poor, it is better for you...} [Quran 2:271]
However, it may be better to disclose voluntary work – as scholars said – if disclosing it serves a valid purpose and the person is safe from Riyaa’, as is the case with the person who hopes to be an example for others in giving and spending in charitable causes. Al-Haytami said:
“When the good deed is free of such flaws and disclosing it does not harm anyone, then if it involves encouraging people to follow one's example ... it is better to disclose it because this is what the Prophets and their followers did; since they only did what is perfect of actions. Also, because its benefit extends to others; the Prophet said, ‘Whoever sets a good precedent will have the reward for that as well as the reward of those who do it after him, without that diminishing their reward in the least.’ If any of these conditions are missing, then it is better to keep the deed secret.” [Az-Zawaajir 'an Iqtiraaf Al-Kabaa'ir]
Hence, if you feel safe from committing Riyaa’, then it is better for you to disclose your charity and tell your friend so that he or others would follow your example, and you would thus earn the reward of the one who sets a good precedent as well as the reward of those who do it after him, without that diminishing their reward in the least.
Allah knows best.