Skip to content

This project demonstrates an automated CI/CD pipeline on AWS for deploying a React static website to an EC2 instance using Docker. It integrates AWS CodeBuild to build the Docker image from GitHub, with credentials stored securely in AWS Systems Manager, and automates deployment through AWS CodePipeline and CodeDeploy.

Notifications You must be signed in to change notification settings

amar0898/AWS-CI-CD-PIPELINE-REACT-PROJECT

Repository files navigation

🚀 React Propel: Automated AWS CI/CD Deployment

Using a 𝗗𝗼𝗰𝗸𝗲𝗿 𝗶𝗺𝗮𝗴𝗲, I recently built an AWS 𝗖𝗜/𝗖𝗗 𝗽𝗶𝗽𝗲𝗹𝗶𝗻𝗲 for deploying my 𝗥𝗲𝗮𝗰𝘁 𝘀𝘁𝗮𝘁𝗶𝗰 𝘄𝗲𝗯𝘀𝗶𝘁𝗲 on an 𝗔𝗪𝗦 𝗘𝗖𝟮 𝗶𝗻𝘀𝘁𝗮𝗻𝗰𝗲. Below you can find the hosted website and my GitHub repository link. Here's the step-by-step process I followed:

1️⃣ 𝗔𝗪𝗦 𝗖𝗼𝗱𝗲𝗕𝘂𝗶𝗹𝗱 𝗦𝗲𝘁𝘂𝗽:

Created a project with 𝗚𝗶𝘁𝗛𝘂𝗯 as the source, using a 𝗯𝘂𝗶𝗹𝗱𝘀𝗽𝗲𝗰.𝘆𝗮𝗺𝗹 file for build instructions and 𝗗𝗼𝗰𝗸𝗲𝗿𝗳𝗶𝗹𝗲 to build the Docker image.

2️⃣ 𝗗𝗼𝗰𝗸𝗲𝗿 𝗖𝗿𝗲𝗱𝗲𝗻𝘁𝗶𝗮𝗹𝘀 𝗦𝗲𝗰𝘂𝗿𝗶𝘁𝘆:

Stored Docker credentials in 𝗔𝗪𝗦 𝗦𝘆𝘀𝘁𝗲𝗺𝘀 𝗠𝗮𝗻𝗮𝗴𝗲𝗿.

3️⃣ 𝗔𝗪𝗦 𝗖𝗼𝗱𝗲𝗣𝗶𝗽𝗲𝗹𝗶𝗻𝗲 𝗦𝗲𝘁𝘂𝗽:

Set up a CodePipeline with 𝗖𝗼𝗱𝗲𝗕𝘂𝗶𝗹𝗱 as the build stage after the source stage.

4️⃣ 𝗘𝗖𝟮 𝗜𝗻𝘀𝘁𝗮𝗻𝗰𝗲 𝗣𝗿𝗼𝘃𝗶𝘀𝗶𝗼𝗻𝗶𝗻𝗴:

Created an EC2 instance to host the website and installed the 𝗖𝗼𝗱𝗲𝗗𝗲𝗽𝗹𝗼𝘆 𝗮𝗴𝗲𝗻𝘁.

5️⃣ 𝗖𝗼𝗱𝗲𝗗𝗲𝗽𝗹𝗼𝘆 𝗦𝗲𝘁𝘂𝗽:

Created a CodeDeploy project to deploy the Docker image and container to the EC2 instance with an 𝗮𝗽𝗽𝘀𝗽𝗲𝗰.𝘆𝗺𝗹 file.

6️⃣ 𝗣𝗶𝗽𝗲𝗹𝗶𝗻𝗲 𝗖𝗼𝗺𝗽𝗹𝗲𝘁𝗶𝗼𝗻:

Added 𝗖𝗼𝗱𝗲𝗗𝗲𝗽𝗹𝗼𝘆 as the deploy stage in 𝗖𝗼𝗱𝗲𝗣𝗶𝗽𝗲𝗹𝗶𝗻𝗲, making the website live on EC2 once all stages are complete.

🚧 𝗖𝗵𝗮𝗹𝗹𝗲𝗻𝗴𝗲𝘀 𝗙𝗮𝗰𝗲𝗱 🚧

Building the AWS CI/CD pipeline and setting up the services together wasn’t easy. There were many challenges, including Docker image issues, but I learned a lot through debugging.

About

This project demonstrates an automated CI/CD pipeline on AWS for deploying a React static website to an EC2 instance using Docker. It integrates AWS CodeBuild to build the Docker image from GitHub, with credentials stored securely in AWS Systems Manager, and automates deployment through AWS CodePipeline and CodeDeploy.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published