Github Integration

Wouldn’t it be great to have versioning, a history of changes to the site, ability to work with multiple developers and integrate code from all of them. Using Git, and more specifically GitHub could help with this.

It would be great to see GitHub integrated into Treepl. I could imagine an integration similar to Heroku, where you could push to the main branch of you repo and it could automatically go live.

I guess then we would need to account for users who make changes on the site. My first take on this is that if a GitHub repo was connected to a site, then when users make changes through the admin interface then it commits and pushes those changes to the repo.

Use cases:
-multiple developers working on the same project.

  • the need to roll back changed to an earlier version.

I say GitHub, but this could just as easily be Bitbucket or GitLab integration also.

I would love to get feedback from other Treepl partners before submitting this to the backlog. Does anybody have any additional use cases that would benefit from GitHub integration? Are there any specific features you would want if this was developed?

1 Like

Hi @Alex_B_Centrifuge

My experience with GitHub is very limited. I have only used it to download different projects that I could use, but have never worked with it where it was “integrated”. Would like to hear more about this and how one would work with it. Without knowing more than the basics it sounds really interesting :slight_smile:

To give a bit more detail on how GitHub integrates with Heroku.
It’s really straight forward, you add you GitHub credentials, you manage a few settings (like the environment, but obviously that wouldn’t be the case on Treepl because it’s one environment), then you click deploy and all your files from your GitHub are deployed to the live site. Then you can set it to auto deploy when somebody pushes to the main branch, essentially keeping your site right up to date.

I imagine you could also use this a development environment option. You could setup a dev site with the same repo and automatically deploy to it when you push to the main branch, then when the dev site looks good, you could manually deploy to the live site.

1 Like

I’d be interested to see how Treepl partners/users feel about Git/GitHub (or similar).

Do you use GitHub (or similar)?
  • No, what is that?
  • No, but it seems interesting to me, or I want to.
  • Sometimes. It’s Okay.
  • Yes, when appropriate.
  • Yes, whenever I can. I love it. Git! Git! Git!

0 voters

1 Like

Yes, I second, third, etc. this vote! Love GitHub as a repository! Version control is amazing!

1 Like

I’ve just implemented github integration for our Treepl sites. This uses the “grunt” nodejs task runner framework and uses FTP to download the files from a Treepl website to the local git repository. We then commit changes and push to github. This gives us change history.

As a part of this I’ve implemented a nodejs webserver that allows a TreePl website to run locally. This improves our development productivity as it allows us to use local development tools and makes using sass easier (no more uploading files to Treepl to see their effect!). The nodejs webserver knows how to process pages into templates and snippets into pages. It doesn’t handle any other liquid markup or modules, but we don’t use that with our development anyway (we let Vuejs do that for us).

I’m working on an automated uploader of changes back to Treepl to close the loop on “proper” source control.

1 Like

@Allistar Thanks for your reply. I use gulp which I think is quite similar to grunt.

So you automatically pull down the site via FTP on a schedule and then automatically push those changes to your local repo? That’s an interesting idea.

You’re using Treepl in a really interesting way. I don’t think I could use it without modules and liquid. How are you using Vuejs as a replacement for modules and liquid? Are you using an external database?

Would you find it a benefit if Treepl had GitHub(GitLab/Bitbucket) integration in the way I described?

What about having reverse integration, so that if admin users make changes, that generated commits and pushes them to a repo? (I’ve never actually seen this implemented, it just kind of came out of my imagination on how to handle user changes and have them not be overwritten)

I guess this raises the question of what would happen if a user pushed a change that conflicted with a change that a dev pushed directly to the repo. Would they have to be notified in some way? Would they need the ability to resolve conflicts?

@A3CS are you currently using Git/GitHub/ versioning with your Treepl sites?

At the moment, no… when I get time I will look at figuring out some sort of integration.

I’ve always found it tough to use CI options. I tried to use BitBucket to deploy to a Treepl. There is a lag to preview changes (I think it was like 10s or more) and you really need to see changes live on the site to see what they’ll look like. I wonder how this service would be FTP Deploy · Actions · GitHub Marketplace · GitHub . I’ll put it on my long list of things to try when I get time.

What yall are wanting is this :slight_smile:

Especially @Alex_B_Centrifuge - this would solve your problem.

@James Agreed. Staging/Production environments would solve my problem mostly.

However I still think there is a case to be made for a good Git integration. While I’ve come up with workarounds (VSCdode Liveshare), it’s not an ideal solution, and for more traditional workflows where multiple developers are working on the same site, Git allows this kind of collaboration, versioning and rollback. It’s an existing system that developers have been using and are used to, so I think you get the benefit of leveraging a system that could be considered a defacto industry standard.