This repository is an example of how to deploy the "Hello, World" of probot apps to Vercel.
We will first start by running the app localy in order to create the GitHub App and initialize the environment variables.
- Install dependencies
npm install
- Start the server
npm start
-
Go to http://localhost:3000/, click
Register GitHub App
and select the app name of your choice. -
Select the repository (or organization) where your GitHub App will be installed. It can be completly different from the GitHub App repo
Well done! Your GitHub app has been created but is not running yet. You can close the process with Ctrl+C
in your terminal.
Note that a file called .env
has been created. It contains all the necessary informations to run your app localy or remotely.
If you want to run your GitHub App localy, you can use
npm start
In this section, we will continuously deployed your GitHub App using Vercel.
-
On your vercel Dashboard, create a new a project.
-
Select your GitHub App's repository.
-
Select a project name and expand the
Environment Variables
view. -
Open the file
.env
and copy all the variables to Vercel Environment Variables. -
Hit deploy !
Your app is now running on Vercel but it is not listening to the correct Webhook url.
-
Go to your GitHub App page and
Edit
your app. -
Replace the
Webhook URL
withhttps://<my-vercel-project-name>.vercel.app/api/github/webhooks
. -
Save
Your GitHub App is now configured to send webhooks to your Vercel app. The api/github/webhooks/index.js file is handling requests to POST /api/github/webhooks
. You can now open an issue on the repo where your app is installed.
Other examples1
Footnotes
-
Do you have any other examples you would like to share? Feel free to open a Pull Request and share yours! ↩