Should I keep my theme on GitHub or not?

AI-generated summary

In a discussion titled “Should I keep my theme on GitHub or not?” under the Dev category, bifterx asks whether it’s best practice to host Discourse theme files on GitHub to avoid overwriting issues when editing CSS via the UI. sam strongly recommends using a Git repo, highlighting the ease of tracking changes and the delightful workflow offered by the theme creator CLI. bifterx thanks sam and confirms the decision. pfaffman seeks clarification on how the CLI integrates with GitHub, wondering if it auto-reloads changes pushed to GitHub. sam clarifies that edits are made locally after checking out the repo, then pushed to GitHub. pfaffman confirms understanding: development on staging, push to GitHub, production pulls updates. sam adds that development can also occur directly on production using temporary themes. Joshua_Kogan expresses interest in seeing live theme examples. bifterx notes their site isn’t live yet but will share screenshots. pfaffman shares enthusiasm after successfully using the CLI again, praising its improved functionality and recalling the need to use an API key.

Sorry if this sounds a bit naive. We have done a fair bit of styling, simple stuff but a fair bit to our Discourse theme with custom CSS tweaks etc. Its a hosted plan, every time I make changes to the CSS in the UI it gives me a warning in regards to updates and overwriting.

Is it best practice to set up a GitHub repo and host all the theme files and theme components there to avoid this issue?

cheers
rob

Absolutely, it is best practice to keep any sizeable theme on a Git repo. It makes tracking changes easier, using theme creator CLI the workflows are delightful so its even easier to hack on.

thank-you sam, decision made.

I’ve missed that. The cli will, what, see that a change has been pushed to github and reload it? I’ve only seen it push local files to discourse. I just reread the announcement and don’t see anything there about github.

You would check out GitHub locally :slight_smile: that way you do all your edits locally, eventually once done you would push it to GitHub.

Ah, so you’d do development on a staging site with the cli, push to github, and production pulls the update from github?

You can dev on production just fine, you would create a temporary component / theme and just give it a diff name. Something like that.

But yeah staging+dev workflow can work a bit more cleanly.

I’m really interested in seeing people’s themes – have a live link?

we are not quite live yet. ill post couple of screens

Oh, wow! I just used it for the first time in a while (after I couldn’t make it work for 2 days because I forgot that you have to use a use API key and thought that there was a different problem, but I digress I just edited the topic to tell people that) and WOW it’s crazy-great now.