You could accomplish this by using your WordPress site as the Single Sign On provider for your Discourse site. The WP Discourse plugin has an SSO Provider option that can be used to set this up.
The tricky part is getting users into Discourse groups. To do this with the WP Discourse plugin you will need to add some code to your WordPress site. There are code examples on this forum that we can point you to for adding users to groups, but you need some way of determining what Discourse groups your WordPress users should get added to. One way to accomplish this is to add a membership plugin to your WordPress site and then add users to Discourse groups based on their WordPress membership level.
To have users signup and get added to Discourse groups without you having to add any custom code, you could look at the Discourse Patreon plugin. Memberful is also a good option.