Ionic Script for auto building apk

Hi, I know this is a little off topic, but it is possible to have a code that I can run through another code to build an apk. And that code will use different config file to change some content for the app. It is like I’d like to build a website that ask the user for info and based on that info the app will be automatically generated and they are going to be able to download that.