Depends what your goal is.
You can just share the Npub like you do for users.
But most will instead want to invite others to experience a community **in a specific app**. For that there's several options:
For Web Apps you can share a URL of the group/community:
- this link can be personalized to the receiving user
- this link can end with the npub so other apps can pick up on it
For Native Apps I'm currently breaking my head on how I want to do this. I have this strong hunch that there's something really awesome that you can do when the community **is** a relay/media server. As in:
- it has a domain
- it can store events, file hashes and even the files (apk's etc...) itselves
- it can whitelist npubs (throw-away npubs included) for access to those events and files
- with cashu you can even set a little starter's budget aside for the invitee