Share your repls and programming experiences

← Back to all posts
Repl.deploy: Automatically deploy from GitHub to Replit, lightning fast ⚡️
h
Khushraj

While deploying projects from GitHub to Replit, do you

  • Commit
  • Push to GitHub
  • Open Replit
  • Pull changes
  • Stop, and
  • Re-run?

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 ⚡️

GitHub Repository (+ Usage): https://github.com/KhushrajRathod/repl.deploy
GitHub Marketplace: https://github.com/marketplace/repl-deploy
Product hunt: https://www.producthunt.com/posts/repl-deploy


How it works:

  • When you commit, GitHub sends an event to a hosted instance of the repl.deploy server
  • 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
    • runs git fetch --all and then git reset --hard origin/main
    • restarts your program
Voters
PaoloAmoroso
programmeruser
maxina
zplusfour
Whippingdot
EpicGamer007
JhonatanTerraza
CookieSnowOwl
HarperframeInc
Nanowrimoijk
Comments
hotnewtop
jeanenchanted

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?

zplusfour

awesome
just saw that on github :)

Whippingdot

wait a sec...how do I test this. How does ur server know which repl is for the github repo?

Khushraj

@Whippingdot Its part of the config file! Instructions on how to use it in the README: https://github.com/KhushrajRathod/repl.deploy

MarcusWeinberger

This is extremely cool and super useful!

Khushraj

@MarcusWeinberger Glad you liked it!

RayhanADev

:O

kewl! I love Replit projects for Replit :D

Khushraj

@RayhanADev :) Thanks!