Learn how to deploy a single page app to Amplify Console hosting directly from the Amplify CLI.
Nader Dabit: [00:01] We start off here with a pretty basic React app. What we'd like to do is deploy this app to the Amplify console hosting service. To get started, we'll initialize a new Amplify project by running amplify init.
[00:14] Here, we'll give the project a name, the environment a name, choose our default text editor and then choose the defaults for the rest of the questions. When prompted for our AWS profile, we'll choose the profile that we'd like to use for this project.
[00:35] After the project has been initialized, we can add hosting by running the amplify add hosting command. For the hosting type, we'll choose Hosting with the Amplify Console. For the deployment type, we'll choose Manual deployment.
[00:51] Now, everything is ready to go, and we can run amplify publish to publish our app. Once the app has been deployed, we'll be given the live URL so we can test out the app.
[01:16] To view the app in the Amplify Console at any time, we can run amplify console from the command line. In the Amplify Console, we can do things like set up custom domains, Access control and other options.
[01:46] Next, let's look at how to deploy an update. I'll go ahead and open the app in my text editor. Here I'll add a new heading that says, "Hello from V2!" To deploy the update, I can now run amplify publish. When we refresh our app, we see that the new version is live.