Skip to content
loading...

Automating My Deploys From GitHub to Glitch

Melissa McEwen on April 21, 2020

Programmers love automation. Anything we have to do over and over again? Automate it! One of these tasks I've been working to automate is deploying... [Read Full]
markdown guide
 

Thank you! This article is awesome!

I was so inspired by the technique you describe that I created a new project, glitcheroo. It lets you deploy an app from a local git repository to a remote Glitch project, kind of like Heroku.

 

Whoa, I'm totally gonna check this out, it sounds awesome.

 
 

Thanks you for this! This Git hook is the missing piece for me to sync changes from GitHub to Glitch directly.

So far I tend to do the other way around, editing and prototyping stuff in Glitch and have it synchronized to GitHub. I have a central repo that runs every morning (on GitHub Actions) to sync my 10+ Glitch projects to GitHub. With this, now I know how to do a two-way sync, yay!

By the way, should the Git hook also run refresh so that changes are reflected in the Glitch editor in case someone is viewing it? Are there any pitfalls of doing that?

 

Ah good idea, I think adding Refresh would help in case you have it open in the editor. I'll try it out.

 

This article was super helpful!
I managed to set two Glitch projects to behave like my development and production environments, with my main repo being in GitHub and everything working CI/CD style. Thank you very much!

I have three comments:

  • I'd clarify that the GitHub action uses somebody else's code from github.com/wei/git-sync
  • The GitHub repo should be public. Otherwise you need to also set a SSH public key as explained in the link above.
  • Minor: In the article you say "Replace YOUR GITHUB REPO URL HERE with your https GitHub URL", but there is no "YOUR GITHUB REPO URL HERE" in the action code (although the solution is obvious :)

Cheers!

JP

 

Thanks for the feedback, just made some edits as suggested :D

 
 

Thanks! That one is interesting too. I needed a solution that didn't alter the code to the project because for example the project in question here is really just a repo of Markdown files and I wanted to keep it that way.

code of conduct - report abuse