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:
Created a project with 𝗚𝗶𝘁𝗛𝘂𝗯 as the source, using a 𝗯𝘂𝗶𝗹𝗱𝘀𝗽𝗲𝗰.𝘆𝗮𝗺𝗹 file for build instructions and 𝗗𝗼𝗰𝗸𝗲𝗿𝗳𝗶𝗹𝗲 to build the Docker image.
Stored Docker credentials in 𝗔𝗪𝗦 𝗦𝘆𝘀𝘁𝗲𝗺𝘀 𝗠𝗮𝗻𝗮𝗴𝗲𝗿.
Set up a CodePipeline with 𝗖𝗼𝗱𝗲𝗕𝘂𝗶𝗹𝗱 as the build stage after the source stage.
Created an EC2 instance to host the website and installed the 𝗖𝗼𝗱𝗲𝗗𝗲𝗽𝗹𝗼𝘆 𝗮𝗴𝗲𝗻𝘁.
Created a CodeDeploy project to deploy the Docker image and container to the EC2 instance with an 𝗮𝗽𝗽𝘀𝗽𝗲𝗰.𝘆𝗺𝗹 file.
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.