Appflow Deploy in subdirectory

My repository is set up to where my ionic app is in a subdirectory (mobile/app). I am trying to do a web build through AppFlow and it is obviously failing because my ionic app is not at the root on my project.

I have tried putting an ionic.config.json with a defaultApp pointing to mobile/app but that fails in just the same way. Any ideas for getting this to work? I would rather not have to blow up my monorepo structure as it has been working great for me.

1 Like

Anyone have any luck with this?

How did you set up your repo for Appflow? Which instructions did you follow?

@sujan12 I understand how to set it up, my ionic project is just in /app/mobile rather than the root of the project. I just need to know for to point to that rather than the root of the project.

I didn’t imply you didn’t know how to set it up, I wanted to know how you did it for context to possibly be able to help you. But :woman_shrugging:

Sorry didn’t mean to come off like that at all. I was following https://ionicframework.com/docs/appflow/quickstart as well as it being pretty helpful just going through the app.

I’m just at a loss because I know it’s looking at the root of the project and not sure how to point it to a subdirectory. I should have included the error:

/usr/local/bin/fastlane: [!] No www found in root of project. (RuntimeError)

So you did connect your Git repo to Ionic Appflow by adding an additional repo (or by using one of the flow for your Git repo hosting). As I understand Appflow, it will clone your repo as a first step as any CI service does. It seems to be looking for a www in the root of the project that it is checking out, which it can’t find as yours lives in mobile/app/www (correct?).

You could now try to e.g. create a symlink from www to mobile/app/www and see if that is enough, but I assume it would also need the config.xml and package.json etc which would be the next error messages.

I am not aware of any option to change the directory Appflow uses to build the app, which also means that it will probably look in /platforms/ios/ for the project which will give you further problems and stuff to symlink away.

As a better solution you could probably extract your Mobile App folder into a sub-repository that you include in the main repository somehow (git submodule probably), and do the Ionic Appflow setup only for that repository. Not sure about the workflow in your monorepo then though.

(Maybe you could also create git repo inside your git repo in the subfolder? Not sure if that is possible or should be used if it is…)