Repl.deploy: Automatically deploy from GitHub to Replit, lightning fast ⚡️
While deploying projects from GitHub to Replit, do you
- Push to GitHub
- Open Replit
- Pull changes
- Stop, and
or, even worse, merge a pull request and then forget to pull changes manually?
Now you don't need to do all of that! Introducing,
repl.deploy, a combination of a GitHub app, written in TypeScript, and a Daemon, written in Go.
repl.deploy lets you automatically deploy from GitHub to Replit, lightning fast ⚡️
How it works:
- When you commit, GitHub sends an event to a hosted instance of the
- A payload consisting of both the endpoint and the current time is prepared and signed with an RSA private key
- The daemon running on the repl recieves the payload, and
- Verifies the signature
- Checks that the endpoint matches (this is to prevent someone from just forwarding a signed request to your repl and causing it to restart)
- Checks that the timestamp is less than 15 seconds old (this is to prevent someone from abusing a signature in the event that a signed request is leaked by you)
- If the request is valid, the daemon
git fetch --alland then
git reset --hard origin/main
- restarts your program
Set up the /refresh endpoint, and log a line in the following format to stdout when a request is recieved: repl.deploy<insert json body here (don't include the angle brackets)><insert "Signature" header here (don't include the angle brackets)>. E.g.
What does this mean?