Deployment

Here, we'll look at how to deploy React apps with two popular serverless hosting providers: Netlify and Vercel.


Connect to GitHub

The first step you'll need to take is to host your code on GitHub. When you create a repository on GitHub, you'll be able to do continuous deployments for your server.

Create a new repo for your project, make sure all of your local changes are committed, then push your project to GitHub. For more information, check out this article about GitHub and how to create a repo.


Deploy with Vercel

1. To get started, make an account or log in If you don't already have an account.

2. Then, click 'Import Project'. Then continue with import git repository.

3. Enter the URL of your GitHub repo. If necessary, adjust your GitHub app settings to allow Vercel access to the repo.

4. Click deploy. It will take a moment for your site to build.

Now your site is online!


Deploy with Netlify

Netlify is a static page provider with Git deploy integration opportunity (GitHub, GitLab, Bitbucket).

1. To get started, make an account or log in If you don't already have an account.

2. Then click New site from Git.

3. Under "Continuous Deployment," click GitHub. If you haven't done so already, give Netlify access to your GitHub repos. Then find your project repo and select it.

4.The third screen "Build options, and deploy!" asks for details about where to create the site and how to build it.

Build command

npm run build

Publish directory

dist

5. Then click Deploy Site. It will take a moment for your site to build.

Now your site is online!


Was this article helpful?
Not really
Yes, Thanks

Can't find what you're looking for? Get in touch with us on our Community Forum.