Netlify : The Simplicity For Deploy React JS

M Sadewa Wicaksana
3 min readFeb 9, 2021

--

Bismillahirrahmaanirrahim,

Today, I’ll elucidate about how to deploy your react-js project in the netlify. I think netlify is the simple way for CI/ CD Integration because when we push our project in Github only a little second netlify will automatically build our new update from the github. Our netlify project in this article here.

Flow process our work
  1. First of all, create a new react-js project using cmd
image of create project react-js
npx create-react-app netlify-app
cd netlify-app
npm start

netlify-app: name of the project

cd: change your directory to the destination path

npm start: to run react js project in deployment.

Notes: Create React App doesn’t handle backend logic or databases; it just creates a frontend build pipeline,

Error create of the project

If you had this error when creating project and the run it, maybe in the project does not contain server.js or in the package.json project is not defined a start script.

"scripts": {
"start": "node your-script.js"
}

The Other Solution is

change your npx to npm init react-app my-app

Message your react js can work properly
View of the new project react js

2. Preparing Github

Create a new repository in Github, and set up the git repo in your folder project.

Create new repo in GitHub
Image to set up your git to your folder project
Success to setup react js project to Github

3. Preparing Netlify

Visit the Netlify website to config our integrations netlify and Github. I recommend that you, log in with your Github account so netlify will detect our project in Github spontaneously.

Netlify Account
  1. Choose new site from git,
  2. There are 3 steps to integrate our project, connect to github to get our permissions, pick the repository you want to deploy, and then set up which branch you want to deploy.

To finish, click Deploy site.

Process deploying our sites

When the 3 steps in the image above succeed, our project is done to deploy

Our Website Succeed to Deploy

Notes:

Our default domain is a random domain, with subdomain .netlify.app but you can customize it in the set up custom domain menu.

When you make a change to your project, and you push again to github production deploys will automatically deploy our project.

Change Site Name

Go to site settings -> Change site name

Stop to Deploy Automatically

Go to menu build&deploy -> stop builds -> save

Happy Coding!!! 😁😁🍜

--

--

M Sadewa Wicaksana
M Sadewa Wicaksana

Written by M Sadewa Wicaksana

Artificial Intelligence and Fullstack Engineering Enthusiast and Still Learning

No responses yet