Coder Social home page Coder Social logo

arun-codemate's Introduction

Probot & Vercel example

This repository is an example of how to deploy the "Hello, World" of probot apps to Vercel.

Create the GiHub App

We will first start by running the app localy in order to create the GitHub App and initialize the environment variables.

  1. Install dependencies
npm install
  1. Start the server
npm start
  1. Go to http://localhost:3000/, click Register GitHub App and select the app name of your choice.

  2. 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.

Run localy

If you want to run your GitHub App localy, you can use

npm start

Deploy on Vercel

In this section, we will continuously deployed your GitHub App using Vercel.

  1. On your vercel Dashboard, create a new a project.

  2. Select your GitHub App's repository.

  3. Select a project name and expand the Environment Variables view.

  4. Open the file .env and copy all the variables to Vercel Environment Variables.

  5. Hit deploy !

Your app is now running on Vercel but it is not listening to the correct Webhook url.

  1. Go to your GitHub App page and Edit your app.

  2. Replace the Webhook URL with https://<my-vercel-project-name>.vercel.app/api/github/webhooks.

  3. 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

License

ISC

Footnotes

  1. Do you have any other examples you would like to share? Feel free to open a Pull Request and share yours! โ†ฉ

arun-codemate's People

Contributors

arun9650 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.