How to add GitHub repositories in Profile Installation
The easiest way is to add the dependencies to your profile's composer.json file, and use Composer to install the profile into your project. The dependencies will be automatically downloaded with it.

Failing that, it'll be a custom script job which will take whatever shape makes sense for your workflow/config.