Deploy a React app to AWS Amplify

Deploy your React app with AWS Amplify

  1. Go to the AWS Amplify console, click on the Get started. Amplify get started

  2. Choose Get started Amplify Hosting. Amplify get started

  3. Choose GitHub and click Continue. Amplify get started

  4. Click Installing & Authorizing Amplify authorize GitHub acc

  5. Click Authorize… Amplify authorize GitHub acc

  6. Enter your GitHub password or authentication code now. Amplify authorize GitHub acc

  7. Choose the repository and main branch you created earlier, then select Next. Amplify get started

  8. Accept the default build settings and select Next. Amplify get started

  9. Review the final details and choose Save and deploy. Amplify get started

  10. AWS Amplify will now build your source code and deploy your app at https://...amplifyapp.com. Amplify Creating an app

Amplify Creating an app 11. When the build is not finished, select the thumbnail to see your web app as displayed in the image below. Amplify Creating an app 12. Once the build completes, click on the URL to see our web app up and running live. To share the URL and then everyone will see this app.

Amplify Deploy no1

Amplify Deploy no1 view

Automatically deploy code changes

Next, we’ll make some changes to the app’s text and see if it automatically tries to deploy the change based on the changes we made.

  1. Open up this source folder and look for the App.js file.
    Amplify edit app

  2. Let us simply adjust this to How to Deploy React App to AWS Amplify? at line 10. Amplify edit cmd Save it and check with our local host. It has changed.

  3. Now we want to push the changes to our Github repo.

git add .
git commit -m "updated text"
git push origin main

So the changes have been pushed to the Github repository. Then we see Amplify automatically start a new build.

  1. Go to the Amplify console, you’ll observe that it automatically starts a new build:

Amplify Deploy no2 When the build is finished, click the URL to see our updated app. Amplify Deploy no1 view