CI/CD Pipeline Using GitHub Action| Auto Deploy Nodejs API on AWS EC2 step by step in Hindi
HTML-код
- Опубликовано: 20 окт 2022
- In this video we will see how to set GitHub Action for cicd with aws EC2 with an example of nodejs API in hindi
GitHub workflows
Cicd pipeline and auto deploy to AWS EC2
CICD pipeline for nodejs express application in hindi
We will Use github action to set up CI CD pipeline to Deploy your project to AWS EC2
Full guide to automatic deployment to AWS EC2 using GitHub Action with nodejs api as example in hindi
It will automatic test build and deploy to aws ec2 after every changes commit and merged
step 1-
login to aws console and create an ec2 instance
step 2-
Login to ec2 instance
step 3-
install nodejs and nginx
sudo apt update
curl -fsSL deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install nodejs
sudo apt-get install nginx
step 4-
push your projects to github
step5 -
create github action
it will create a yml file under .github/workflow
just edit yml file acording to your project
step 6-
set up github action on ec2
Not start with sudo
After GitHub configuration run this command
sudo ./svc.sh install
sudo ./svc.sh start
step 7-
install pm2 and run backend in background
npm i pm2 -g
pm2 start server.js
step 8-
add the command in yml script of project to restart after every commit
-run: sudo pm2 restart server.js
step 9-
config nginx and restart it
Cd /etc/nginx
Cd sites-available
sudo nano default
location /api/ {
proxy_pass localhost:8000/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
sudo systemctl restart nginx
#cicd #githubactions #github #ec2 #nginx #nodejstutorial
Fantastic way of teaching . cristal and clear. Please continue your journey . Best of luck🙂
i think this tutorial basically got me a Cloud Intern job. thank you so much.
Excellent tutorial just loved it🔥
Keep creating great tutorials on devoops
Excellent and clear -cut ! love the video
Wow! That explanation is outstanding!
Wow! That explanation was truly outstanding!
Выберите нужный вариант: Выберите нужный вариант:
Thanks for sharing this information in clear and simple way.😊
Very very useful information. Keep it up. Nice content 👍
Very helpful tutorial, you explained it very easily. Thank you so much!
great work 🔥🔥,
from this video, no one needs any other explanation.
Thanks
This is gem video on internet thanks mam 😇
Thank you so much, this was a very helpful video !!
Thanks
It's really helpful. Thank you so much.
Thanks
0:36 0:36 0:38 Excellent tutorial on Node.js deployment and CI/CD! The step-by-step walkthrough really helped me understand the process. Setting up continuous integration and continuous deployment is crucial for a smooth development workflow, and your explanations made it easy to follow. The use of Node.js for backend development is growing, so having a solid deployment strategy is key. Thanks for sharing this valuable content! 👍 #NodeJS #CICD #DevelopmentWorkflow
Thanks
thankyou ma'am, great video.
A great video keep the good content uploaded thanks alot
Thanks
everything worked well just use "run - pm2 restart server"
excellent video ma'am, thanks, I wish you had added some test cases also. that helps us more, by the way, the superb video helped me a lot. thanks,🙏🙏
Thank you. Ok I will add test cases and make a tutorial on that.
@@shreelearning3698 so nice of you ma'am, I will be thankful.
very helpful thanks.
Bahut achchha.
Awesome ❤
This helped Thanks
very informative
Very helpful 👍
Thanks
very impressive
Thank You Madam
Nice 👍👍👍
Thanks😀
Awesome
perfect
thank you
great
Great
Thanks
Mam i am really happy that you are posting such informative long videos with each and every step in details it helps us a lot
but this is my third time following the same process but this " _work " is always missing when is check in action-runner folder
i dont know why this happens but i followed the same steps but " _work " is not created
Thanks..It must be created. Check it once see if you are missing anything
This was an issue for me too. The solution here is to make sure you trigger your workflow by giving a PR or pushing to the branch (based on how you've configured your workflow yml file) after you've installed and ran svc script. Only then the _work folder will be created. Hope this helps.
@@pavansoratur9475 Spend 3 hours and i just give up. Then suddenly thought some legend maybe put the question and answer in comment section. Thanks Brothers
does github actions require any other configuration for private repository ?
Very very informative video and everything works. Superb explaination.
I have a question like, can we configure multiple CI/CD Pipeline from different-different repositories to single server. Like if I do changes in repo so that repo should be deployed only. If yes then how? is there any video?
I have a question like, can we configure multiple CI/CD Pipeline from different-different repositories to single server. Like if I do changes in repo so that repo should be deployed only. If yes then how? is there any video?
@@nitinsharma4014 I never tried that you can try.
can i use this same things for production environment ? give me full details
this is very useful and excellent video for those who deploy REST API on AWS, I have one Q my server file is ts instead of js how can we start aws server with pm2? my local machine start server with nodemon
You can go to dist folder and start running application on pm2
cd ./dist
pm2 start your-app.js --name your-app-name
@@shreelearning3698 I have server.ts using typescript (ts-node) run on local serve using nodemon problem is when i run through nodemon its okay but when try to run using PM2 its return error.....
Ma’am can you make videos on Jenkins
Thank you so much 👍
mam please .ppk file se mujhe karna tha kyu ki me ek windows user hu to wahase me thoda samajh nhi paya but last tak dekha apka teaching style is very awesome.........plz .ppk ke liye ek video banaiye kyu jyadatar windows user hi he 🙏🙏🙏🙏🙏🙏
Okay sure
My window machine is currently not working... But you can download Mobaxterm on windows and follow the same commands as Mac . It will allow you to write Linux commands. And you can connect through .pem file
Открой дверь
09:05 actions
20:15 action runner
Please create a video on nextjs with digital ocean CI/CD
Can someone help me please i have github action and there is SIT and UAT already present so my task is - create a branch for PRE PROD in github action how to do and what need to be configure there please help me guys
Thanks for the video.
Can you please let me know a way to add env variables as whenever i add them in the main project directory (inside _work/project_name/project_name) it gets removed automatically after a deploy again and restart the nginx and throws error?
You can create a config file inside your project directory and define and export all the variables. Then you can import and use in any file.
bro did you get an solution?
i cant find _work folder inside action runner directory. help me out.
How does it install all the dependencies from package.json ?
Mam app jese EC2 ka kiye the wese kal ek video upload kijie jaha hum ek simple node.js web application ko docker me deploy kar sakte he plz aur yahi style me padhaie plz kyu ki app badhia ekdum bit by bit padhate he to wo achha lagta he
Thanks. I will upload with docker
@@shreelearning3698 to fir mam aj hi kijie na plz 🙏🙏🙏🙏
what is the tool you used for triggering the REST APIs from your system?
Postman
make a tutorial for jenkins also
Okay
not getting _work folder after starting also what's the issue ?
great work 🔥🔥🔥🔥
Kindly check if you are missing anything
I have used prisma client as an ORM and expressJs for rest api, how to deploy that ?
Same process, you just need to set up your SQL data base in the server and give the server credentials where you are giving your local credentials for db connection. Others are pretty much the same
Agar hm Linux machine ka use krenge to koi issue aayega kya instead of ubuntu and aapne Jo command Diya hai usmai kuch changes bhi karna hoga kya?
Koi issue ni ayega bas kuch commands ka changes karna hoga.. you can search for the same command for Linux in Google you will easily get it.
Ma'am how to pass the .env file. Every application has a .env file and and the irony is none of the tutorial cover it.
You can create a .env file in server inside your application folder and use it.
I have one question? How We manage .env file in those api. And thanks for the content.
same question..did u get an answer?
@@rishabhranjan5047 There is way I found is store the env data in github secrets and create a env file with the github action with adding those secets to that env file
Creating an optimized production build...
The build failed because the process exited too early. This probably means the system ran out of memory or someone called `kill -9` on the process.
Error: The operation was canceled. I am getting this
Mam abhi url http se start ho rahi he but use https me kese change kar sakte he
does github actions charges money on indiviual's private repository ?
There are some minutes and storage is free to use GitHub hosted runners. Beyond that it may cost.
Jenkins Alternative hai kya
Yes
Runner getting stopped after , disk of system is full , how to deal it with
You need to extend the storage in EC2. You can use Amazon Elastic Block Storage
SSL Bhi bta dete aap
How can i manage my env file in deployment
After deploy you can create .env file in server inside your application folder and put all secrets there or you can use AWS secret manager
_work folder is not reflecting in my case on ec2
same
Same issue here too. But it resolved by checking logs in github/actions - build shows the error from code deploy or build or npm clean install. Once it was resolved from my code, then continue with her instruction, it will populate _work folder for you.
Mujhe github action me CI/CD
Smjh me nhi aa rha hai bht struggle kr rha hoo ....😢😢😢😢😢
Event, trigger,stage ,checkout ,stage and so on ......kiya smjh me nhi hai .........
😢😢😢😢😢😢😢😢😢
Ek vedio github action ka banaiye biggner to Advanced plz ...😢😢
Bht struggle kr rha mam Non IT se background se hoo or avi IT me as adevops trainee job ke rha hoo mujhe GitHub action smjh me nhi a rha hai 😔😔