Should I Avoid Doing Good Deeds in Public?

Sometimes I refrain from doing good deeds out of fear that people will see me, and I’m not 100% sure of my intentions, and whether I do these deeds partly to show off that I am a good Muslim. Is this a trick of Satan to make me not do these good deeds?