Skip to content

Commit cedaf4b

Browse files
LucBergegr2m
andauthored
docs(README): Enhance instructions (#74)
Co-authored-by: Gregor Martynus <[email protected]>
1 parent ca640b0 commit cedaf4b

File tree

1 file changed

+34
-12
lines changed

1 file changed

+34
-12
lines changed

README.md

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,57 @@
22

33
This repository is an example of how to deploy the "Hello, World" of probot apps to [Vercel](https://vercel.com).
44

5-
## Local setup
5+
## Create the GiHub App
66

7-
Install dependencies
7+
We will first start by running the app localy in order to create the GitHub App and initialize the environment variables.
88

9+
1. Install dependencies
910
```
1011
npm install
1112
```
1213

13-
Start the server
14+
2. Start the server
15+
```
16+
npm start
17+
```
18+
19+
3. Go to http://localhost:3000/, click `Register GitHub App` and select the app name of your choice.
20+
21+
4. Select the repository (or organization) where your GitHub App will be installed. _It can be completly different from the GitHub App repo_
22+
23+
Well done! Your GitHub app has been created but is not running yet. You can close the process with `Ctrl+C` in your terminal.
24+
Note that a file called `.env` has been created. It contains all the necessary informations to run your app localy or remotely.
1425

26+
## Run localy
27+
28+
If you want to run your GitHub App localy, you can use
1529
```
1630
npm start
1731
```
1832

19-
Follow the instructions to register a new GitHub app.
33+
## Deploy on Vercel
34+
35+
In this section, we will continuously deployed your GitHub App using [Vercel](https://vercel.com).
36+
37+
1. On your vercel Dashboard, create a new a project.
38+
39+
2. Select your GitHub App's repository.
40+
41+
3. Select a project name and expand the `Environment Variables` view.
42+
43+
4. Open the file `.env` and copy all the variables to Vercel Environment Variables.
2044

21-
## Deployment
45+
5. Hit deploy !
2246

23-
The app is continuously deployed using [Vercel's GitHub app](https://github.com/apps/vercel).
47+
Your app is now running on Vercel but it is not listening to the correct Webhook url.
2448

25-
### Considerations
26-
- Make sure you configure [the environment variables for your GitHub App](https://probot.github.io/docs/configuration/) in Vercel. You can read more about how to do it in [their docs](https://vercel.com/docs/concepts/projects/environment-variables).
27-
- Vercel [expects to find your lambda functions under `/api` folder]([url](https://vercel.com/docs/concepts/functions/serverless-functions#deploying-serverless-functions)). Make sure your functions are placed there and double check Vercel detected your Lambda Functions during the deployment process by checking the logs:
49+
6. Go to your [GitHub App page](https://github.com/settings/apps) and `Edit` your app.
2850

29-
![image](https://user-images.githubusercontent.com/2574275/187179364-b0019f95-be41-462a-97d5-facf4de39095.png)
51+
7. Replace the `Webhook URL` with `https://<my-vercel-project-name>.vercel.app/api/github/webhooks`.
3052

31-
## How it works
53+
8. Save
3254

33-
The [api/github/webhooks/index.js](api/github/webhooks/index.js) file is handling requests to `POST /api/github/webhooks`, make sure to configure your GitHub App registration's webhook URL accordingly.
55+
Your GitHub App is now configured to send webhooks to your Vercel app. The [api/github/webhooks/index.js](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.
3456

3557
## Other examples[^1]
3658
- [Using TypeScript + Vercel](https://github.com/oscard0m/example-vercel-ts) by [@oscard0m](https://github.com/oscard0m)

0 commit comments

Comments
 (0)