I want to use git submodule with astro. With backend code on the submodule and frontend and ssr on the main git repo. I'm new to git module. So want to get some benefits from it. As of my knowledge both git repos will have astro project. When using one as submodule. It will bring the whole repo with it. Now would i be hosting 2 sites? or what?
#git Submodule Astro
7 messages · Page 1 of 1 (latest)
Hi @grim canopy. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
Hmm, I don't know enough to give you a confident answer yet. The knowledge sources provided do not contain specific information about using git submodules with Astro. However, they do provide information on how to deploy Astro sites to various hosting platforms like GitHub Pages (https://docs.astro.build/en/guides/deploy/github/#_top), GitLab Pages (https://docs.astro.build/en/guides/deploy/gitlab/#_top), and Cloudflare Pages (https://docs.astro.build/en/guides/deploy/cloudflare/#_top).
In general, a git submodule allows you to keep a Git repository as a subdirectory of another Git repository. This lets you clone another repository into your project and keep your commits separate.
As for your question about hosting, it would depend on how you set up your projects and your hosting platform. If both repositories are Astro projects and you set up deployments for both, then yes, you could potentially be hosting two separate sites.
For more specific guidance, I would recommend checking out the Astro Documentation (https://docs.astro.build/) or seeking advice from the Astro community or a knowledgeable colleague.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@grim canopy kapa.ai is still learning and improving, please let us know how it did by reacting below
@lament quail If i can host both of them at the same time on same site can you give me some knowledge on that? becuase normally i would give hosting site like vercel one path to host. No?
Let me check the knowledge base for you. One moment! :books:
Based on the provided knowledge sources, when deploying an Astro project, you typically specify a single build command and publish directory. For example, with Vercel, you would use the astro build command and set the publish directory to dist.
Build Command: astro build or npm run build
Publish directory: dist
(Source: Astro Documentation (https://docs.astro.build/en/guides/deploy/#quick-deploy-options))
If you have two separate Astro projects (one in your main repository and one in your submodule), and you want to host them as a single site, you would need to configure your build process to build both projects and output them to a shared publish directory.
However, the specifics of how to do this would depend on the structure of your projects and your hosting platform. The provided knowledge sources do not contain detailed information on how to configure a build process for multiple Astro projects in a single repository.