Upload site to github and custom domain

In package.json add this line

“homepage”: “https://yourcustomdomain.com”

Install gh-pages with npm install -D gh-pages

In package.json in scripts add
“predeploy”: “npm run build”,

“deploly”: “gh-pages -d build”,


“deploy”: “npm run build && gh-pages -d build”


to copy the cname from root to dist folder

“deploy”: “npm run build && cp && gh-pages -d build”

push changes to master

npm run deploy
Purchase the domain and go to DNS settings and add the A record to it.Then add the CNAME to it

Type Host Name Value TTL
A @ 20min
A @ 20min
A @ 20min
A @ 20min
CNAME www username.github.io. Automatic
In the root of your project or the public folder should have a “CNAME” File, add it, which should have the domain name eg. somedomain.com

Wait for 15mins or so to update changes on the nameservers.