Why Astro?
Astro is an all-in-one web framework for building fast, content-focused websites. It is really good for SEO especially as it is lightning-fast website performance, making it ideal for modern web applications and static websites.
AWS Amplify
AWS Amplify is a fully managed CI/CD and hosting service that is perfect for web applications.
Key Points:
-Fully Managed CI/CD: Amplify takes care of the complexities of the CI/CD pipeline, allowing developers to focus on building and refining their applications.
-Hosting Excellence: With AWS Amplify, hosting becomes a breeze, ensuring your web applications are readily available to users.
Prerequisite:
1st create an auto app on your local machine.
Use this tutorial to create your 1st astro app:
Link: https://docs.astro.build/en/tutorial/1-setup/2/
Once it is on your Github we can now set it up on AWS Amplify.
This will done by creating a CI/CD pipeline from GitHub to AWS Amplify where the app will be deployed.
Deploy to AWS:
- Log in to AWS and navigate to Amplify in the N. Virginia region or any other region you like.
- Click "Get Started" and select "Host your web app" as demonstrated.:
- Click on Get Started & click on Host your web app.
- Choose GitHub and install AWS Amplify (us-east-1)
- You'll be redirected to a page to install and authorize AWS Amplify on GitHub. Select the GitHub repository for your Astro app. Mine is https://github.com/OrinaOisera/Astro_app
- After successful authorization, choose the branch (e.g., master) and proceed by clicking "Next."
- Navigate to the app build and test settings.
- Scroll down to the advanced settings, locate "Live Package Update," and update the Node.js version to 20.
- Save your changes and initiate the deployment.
- Expect the build to fail. 11.Click on "Build," leading you to the build logs, where you'll identify an issue related to Node.js version compatibility. Astro v 3 require Node js 18 and AWS amplify fail to build due to version `GLIBC_2.27' not found (required by node) Is because the Linux version is not the latest one.
- In the sidebar, go to build settings and scroll to "Build Image Settings." Build an image is Amazon Linux default
- Update "Build an image" from "Amazon Linux default" to "Amazon Linux:2023," and save the changes.
- Scroll back up and click "Redeploy this version" on the top right.
- Verify that the deployment is successful & Click the URL to preview the website.
Top comments (0)