I'm not sure if there are other ways, better or not... but blackbox[1] can be used to store secrets.
And it might be possible to achieve some success with git filters[2], at least to avoid pushing secrets into the repository.
Still... just my two cents, I'm not exactly a pro-user of those two features
[1](https://github.com/StackExchange/blackbox)
[2](https://stackoverflow.com/questions/6557467/can-git-ignore-a...)