Caution: Don't mix and match Github deploy and in-Ghost theme edits

Hey folks!

Just a quick note: A couple months ago, Ghost launched the ability to edit the theme right within Ghost settings.

Many of us (er… at least us tech-y folks) have long maintained themes over in Github, and we use the Github actions deploy to get theme edits live on site.

Today, I discovered (too late) that one of the staff users on the site I was working on had made edits direct in Ghost. [In my defense, I asked first, but I asked the wrong member of the team, apparently!] So, when I pulled changes from GH before editing, and pushed changes back to GH (that then auto-deployed to Ghost), I inadvertently overwrote his theme edits.

So… just a heads up that if you’re deploying from Github and there’s anyone else who might have done in-Ghost edits, it’s easy to accidentally overwrite their work, and since the changes aren’t tracked anywhere, they’re just gone, as far as we could figure out today.

[Happily in this case, the person whose edits I deleted had a local copy, so all’s good here, but I’d hate for others to lose work that’d be harder to recreate.]

Technically our GitHub deploy jobs can “pull” (download) the current theme from the actual site and compare it with the base version, before overwriting it (or failing).

Or, a manual or scheduled CI job can fetch the latest changes from the site, and push it to the main branch. So, the changes outside of the git repository can be treated as an external committer.

I think this can be a good practice.

That’s a good point! I’d love to see someone set that up and share a how-to. :grin:

+1 sounds like a great setup