This project demonstrates a Continuous Integration and Continuous Deployment (CI/CD) pipeline for a Node.js application. The pipeline includes manual deployment to AWS EC2, automation using Docker, and also a pipeline built using GitHub Actions with a webhook integration.
- Set up an AWS EC2 instance.
- Install Jenkins on the EC2 instance.
- Create a new Jenkins job for the Node.js application.
- Configure the job to check out the code from a source code repository.
- Add build steps to compile and package the code.
- Add a post-build action to deploy the code to the EC2 instance.
- Create a Docker image for the Node.js application.
- Modify the Jenkins job to use the Docker image instead of building the code directly.
- Update the post-build action to deploy the Docker container to the EC2 instance.
- Create a new GitHub Actions workflow for the Node.js application.
- Add steps to build and package the code.
- Enable the GitHub Actions workflow for the repository.
- Add a webhook to trigger the workflow when changes are pushed to the repository.
This CI/CD pipeline provides a robust and automated solution for deploying a Node.js application to AWS EC2. By using Docker, the pipeline can be easily adapted to different environments and scaled as needed. The integration with GitHub Actions and the use of a webhook make it easy to keep the pipeline up-to-date with the latest changes to the code.