{"id":22266053,"url":"https://github.com/muhdhanish/git_actions_nodejs","last_synced_at":"2026-05-03T09:38:49.176Z","repository":{"id":215592700,"uuid":"739314350","full_name":"MuhdHanish/git_actions_nodejs","owner":"MuhdHanish","description":"This repository serves as a learning resource for Continuous Integration and Continuous Deployment (CI/CD) in the context of a simple Node.js server.","archived":false,"fork":false,"pushed_at":"2024-01-05T14:36:15.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-30T13:13:17.135Z","etag":null,"topics":["aws","backend-api","cicd-pipeline","nodejs","rest-api"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MuhdHanish.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-05T09:15:08.000Z","updated_at":"2024-01-13T11:18:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"7619abb5-79e8-45c7-b2d5-aef9ee098d1b","html_url":"https://github.com/MuhdHanish/git_actions_nodejs","commit_stats":null,"previous_names":["muhdhanish/git_actions_nodejs"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MuhdHanish%2Fgit_actions_nodejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MuhdHanish%2Fgit_actions_nodejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MuhdHanish%2Fgit_actions_nodejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MuhdHanish%2Fgit_actions_nodejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MuhdHanish","download_url":"https://codeload.github.com/MuhdHanish/git_actions_nodejs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245476726,"owners_count":20621703,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","backend-api","cicd-pipeline","nodejs","rest-api"],"created_at":"2024-12-03T10:17:34.434Z","updated_at":"2026-05-03T09:38:49.137Z","avatar_url":"https://github.com/MuhdHanish.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deploy Nodejs project to Amazon EC2 with Github Actions\n\n## After successfully connecting github to remote server follow this commands\n\n### Step 1: Update Package Repositories\n\nRun the following command to update your package repositories:\n\n```bash\nsudo apt update\n```\n\n### Step 2: Install Node.js\n\nInstall Node.js using the following command:\n\n```bash\nsudo apt-get install -y nodejs\n```\n\n### Step 3: Install Nginx\n\nInstall Nginx to act as a reverse proxy for your Node.js application:\n\n```bash\nsudo apt-get install -y nginx\n```\n\n### Step 4: Install PM2\n\nInstall PM2 globally to manage your Node.js application:\n\n```bash\nsudo npm i -g pm2\n```\n\n### Step 5: Configure Nginx\n\nNavigate to the Nginx sites-available directory and open the default configuration file for editing:\n\n```bash\ncd /etc/nginx/sites-available\nsudo nano default\n```\n\nInside the Nginx configuration file, add the following block to configure the reverse proxy for your API:\n\n```nginx\nlocation / {\n    proxy_pass http://localhost:8000;\n    proxy_set_header Host $host;\n    proxy_set_header X-Real-IP $remote_addr;\n    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n}\n```\n\n### Step 6: Restart Nginx\n\nAfter making changes to the Nginx configuration, restart Nginx to apply the changes:\n\n```bash\nsudo systemctl restart nginx\n```\n\n### Step 7: Start Your Node.js Application with PM2\n\nNavigate to your project directory and start your Node.js application using PM2. Replace `server.js` with the actual filename of your Node.js application:\n\n```bash\ncd /path/to/your/app\npm2 start server.js --name=server\n```\n\n### Step 8: Restart Your Node.js Application with PM2 (Optional)\n\nIf you need to restart your Node.js application managed by PM2, you can use the following command:\n\n```bash\npm2 restart server\n```\n\nThese steps should help you set up a Node.js backend API with Nginx and PM2 on your Debian-based Linux system. Make sure to customize the paths and filenames according to your specific project.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuhdhanish%2Fgit_actions_nodejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmuhdhanish%2Fgit_actions_nodejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuhdhanish%2Fgit_actions_nodejs/lists"}