Great writeup, @tunjos, and welcome to our community!
Our deploys do indeed publish ONLY the publish directory you have configured (or the root of your repo / your base setting, if none is specified). So to publish “many directories”, they’d need to be subdirectories of your app and would need to be in the publish directory.
You could try something like this in your build pipeline that may help adjust the organization, but I suspect it would be a problem for other reasons - e.g. jekyll would reference the wrong paths for such assets in its generated html.
jekyll build && mv ../assets assets ...
I guess you could also deploy the shared assets in a 4th site and refer to them by name (https://othersite/assets/X) from every one of the 3 sites sharing access?
Finally, you could proxy between the sites - or proxy the assets folder between sites - to deploy only one copy of it. This could work with or without that 4th dedicated site I mention, and some guidance on that workflow (think of your “separate monorepo-built sites” here as being “separate repos” to see the direct application):
One more note - if you do end up copying the assets to each of your 3 sites’ publish directories as you build, this will not meaningfully impact your build times - we will not “re-upload” copies of unchanged files from a prior build EVEN ON ANOTHER SITE - so you won’t have to pay the time for uploading/processing repeatedly (just on first upload).
Regarding your first suggestion, I think it would be more like: jekyll build && mv ../assets _site/assets ..., since _site is the default Jekyll output directory.
I do think this would work, as the URLs would simply reference the non-existent _site/assets path from the start. However, I’ll be unable to seamlessly do a jekyll serve locally, without doing the additional move step.
The second option would kinda interfere with the local preview. Same for the proxy suggestion/option.
What I currently do is to use a sync.sh script to copy all assets from the main site to other subsites locally before doing a commit. e.g. cp -a www.company.com/assets/. app.company.com/assets cp -a www.company.com/assets/. docs.company.com/assets
And I always make sure that any edit to an asset is done on the main site so that it can be synced.
I do think your first option would be very sufficient for now though. Thank you very much.
The final tip helpful too.