Deploying your Agility CMS Create React App

Follow

 

Now that you have your site Agility CMS Create React App running locally, let's deploy it to a static web host. There are many out there, however, our favorite is Netlify.

Before we do anything, we need to build a production version of our web app, which will build it to the /build folder:

> npm run build

Now, install the netlify-cli:

> npm install -g netlify-cli

Next, login/signup to Netlify using:

Tip: sign up using your Github account if you have one, it will come in handy as you can easily set up CI/D with Netlify and Github

> netlify login

This will launch a browser window for you to signup/login and authenticate the cli.

You should see this message in your cli once you've logged in:

mceclip2.png

Now that you are logged in, you can deploy the site in a few easy steps:

> netlify deploy --dir=build --open

mceclip3.png

Now, select Create & configure a new site and select a team - you can leave this as the default option (your name):

mceclip4.png

Next, hit enter to choose the default name, or enter a new name:

mceclip5.png

Now that you've deployed your site to a draft site, you can review it there and decide if it's ready for production. You can then continue to deploy to production by using the --prod argument:

> netlify deploy --dir=build --open --prod
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.