This tutorial guides you through deploying a frontend application from a GitHub repository to AWS Amplify

Prerequisites:

  • An AWS account with appropriate permissions.

  • An existing GitHub repository with a branch named <environment>

Steps:

  • In the Amplify console, create a new app → Host web app

  • Select Github.

  • Select your repository from the list.

  • Choose the specific branch you want to deploy from

  • Configure Build Settings:

    • App name lend2b-<environment>

    • In Build and test settings click in edit button.

    • Edit the command section and add npm run build

    • Edit the baseDirectory and add dist

    • Save and Deploy

  • In the "Environment variables" section, click in Manage Variables and add the following:

    • VITE_API_URL: URL of your backend API

      • https://<environment>-api.lend2b.com

    • VITE_APPSYNC_API_KEY: Your Appsync API Key

    • VITE_POOL_ID: Your Cognito User Pool ID

    • VITE_CLIENT_ID: Your Cognito Client ID

    • VITE_ENVIRONMENT: Indicate the environment

    • VITE_GRAPHQL_URL: URL of your GraphQL endpoint

  • Deploy your Application