nodejs-rest-api-EC2
This project demonstrates how to automatically deploy a Node.js REST API on an AWS EC2 instance using a CI/CD pipeline powered by GitHub Actions. It provides a complete setup for streamlining the integration and deployment process, enabling developers to push code changes that are automatically built, tested, and deployed to production. The CI workflow runs on every push to the main branch, checking out the code, setting up the Node.js environment, installing dependencies, and running tests. The CD workflow triggers after successful CI, SSHing into the EC2 instance, pulling the latest changes, and restarting the application. Key components include a self-hosted GitHub Actions runner configured on the EC2 instance, Nginx configured as a reverse proxy, and PM2 for process management to keep the Node.js application running reliably. Environment variables are managed through a .env file registered as GitHub secrets. The repository includes a sample Node.js application with a server.js entry point, package.json fo