Hugo deployment from 2 separate repos

Hi there,

I have a Hugo theme which is private repo that I do not share with my clients. (repo 1- Hugo theme)

Then I have multiple other themes connected to cloudflare pages for each website. (repo 2 - Hugo without the theme)

It will be great is there is a solution where I can setup cloudflare pages to say of this repo use Hugo theme from this private GitHub repo.

USing submodule is not available for private repos. IS there a solution which can do this.

This way when I will update the theme it will automatically update all website. and also I do not need to deploy theme in all repositories and also I can keep the theme private.

Thanks

A submodule can be a private repo, as long as your Cloudflare account has access to it. I set it to have access to all repos, and I use private submodules.

The parent project will NOT rebuild on an update to the submodule. You have to update the site project to use the updated theme, and commit that change, for it to be rebuilt and deployed.

2 Likes

hi @i40west

I try really hard to understand what you mean? do you have an example repo which is setup in the way you describe? Thanks

When you set up the connection to Github, you can give it access to all your repos. You can also select specific repos to give access to, including private ones. You can modify this setting in your Github account settings:

As long as Cloudflare has access to your private repo you can use it as a submodule for builds. No one but you can access them, of course, but your own builds can use them even though they are private.

But the sites using the theme won’t be updated automatically when the theme is updated. You need to update the site’s repo to use the new version of the submodule.

1 Like