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

Комментарии • 103

  • @asifrahman2155
    @asifrahman2155 6 месяцев назад

    Fantastic way of teaching . cristal and clear. Please continue your journey . Best of luck🙂

  • @user-xg1td7bw7m
    @user-xg1td7bw7m 11 месяцев назад +4

    i think this tutorial basically got me a Cloud Intern job. thank you so much.

  • @mdshadab3470
    @mdshadab3470 10 месяцев назад +1

    Excellent tutorial just loved it🔥
    Keep creating great tutorials on devoops

  • @itsabhi.
    @itsabhi. 5 месяцев назад

    Excellent and clear -cut ! love the video

  • @mayurkothari8761
    @mayurkothari8761 6 месяцев назад

    Wow! That explanation is outstanding!

  • @I_am_Jisu
    @I_am_Jisu Год назад +2

    Wow! That explanation was truly outstanding!

    • @user-bb9oi9xk4v
      @user-bb9oi9xk4v Год назад

      Выберите нужный вариант: Выберите нужный вариант:

  • @AbhiBhardwaj1289
    @AbhiBhardwaj1289 3 месяца назад

    Thanks for sharing this information in clear and simple way.😊

  • @VipinKumar-hg2qp
    @VipinKumar-hg2qp Год назад

    Very very useful information. Keep it up. Nice content 👍

  • @AbhishekPratapSolanki-ns8zl
    @AbhishekPratapSolanki-ns8zl 2 месяца назад

    Very helpful tutorial, you explained it very easily. Thank you so much!

  • @ashutoshgamingboy3683
    @ashutoshgamingboy3683 7 месяцев назад

    great work 🔥🔥,
    from this video, no one needs any other explanation.

  • @sanketkothiya3034
    @sanketkothiya3034 7 месяцев назад +2

    This is gem video on internet thanks mam 😇

  • @pavansoratur9475
    @pavansoratur9475 Год назад

    Thank you so much, this was a very helpful video !!

  • @mktNo1
    @mktNo1 Год назад

    It's really helpful. Thank you so much.

  • @Yadav_Hitesh
    @Yadav_Hitesh 6 месяцев назад +1

    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

  • @simranbanwait
    @simranbanwait 11 месяцев назад

    thankyou ma'am, great video.

  • @nomanashraf8130
    @nomanashraf8130 Год назад

    A great video keep the good content uploaded thanks alot

  • @sachinpunera2564
    @sachinpunera2564 Год назад

    everything worked well just use "run - pm2 restart server"

  • @prashanttiwari7398
    @prashanttiwari7398 Год назад

    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,🙏🙏

    • @shreelearning3698
      @shreelearning3698  Год назад

      Thank you. Ok I will add test cases and make a tutorial on that.

    • @prashanttiwari7398
      @prashanttiwari7398 Год назад

      @@shreelearning3698 so nice of you ma'am, I will be thankful.

  • @rahulnamdev3616
    @rahulnamdev3616 6 месяцев назад

    very helpful thanks.

  • @raviprakashagrawal9478
    @raviprakashagrawal9478 Год назад

    Bahut achchha.

  • @technicalabhi7683
    @technicalabhi7683 Год назад

    Awesome ❤

  • @shuhaibahamed7425
    @shuhaibahamed7425 Год назад

    This helped Thanks

  • @ratnarajanand9407
    @ratnarajanand9407 Год назад

    very informative

  • @vikaspatel8105
    @vikaspatel8105 Год назад

    Very helpful 👍

  • @shakeebanwar4403
    @shakeebanwar4403 Год назад

    very impressive

  • @sinchanmaity8825
    @sinchanmaity8825 6 месяцев назад

    Thank You Madam

  • @alaluddin9005
    @alaluddin9005 10 месяцев назад +1

    Nice 👍👍👍

  • @rajchauhan3311
    @rajchauhan3311 Год назад

    Thanks😀

  • @aamirmahmood9264
    @aamirmahmood9264 Год назад

    Awesome

  • @orophile05
    @orophile05 Год назад

    perfect

  • @pritam0793
    @pritam0793 10 месяцев назад

    thank you

  • @omkarwaghchaure5890
    @omkarwaghchaure5890 9 месяцев назад

    great

  • @stevefotso9703
    @stevefotso9703 Год назад

    Great

  • @ritikraj3360
    @ritikraj3360 Год назад +1

    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

    • @shreelearning3698
      @shreelearning3698  Год назад +1

      Thanks..It must be created. Check it once see if you are missing anything

    • @pavansoratur9475
      @pavansoratur9475 Год назад +3

      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.

    • @talhariaz7787
      @talhariaz7787 Год назад

      @@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

  • @jigneshkumar5698
    @jigneshkumar5698 Год назад +1

    does github actions require any other configuration for private repository ?

  • @nitinsharma4014
    @nitinsharma4014 Год назад

    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?

    • @nitinsharma4014
      @nitinsharma4014 Год назад

      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?

    • @shreelearning3698
      @shreelearning3698  Год назад

      @@nitinsharma4014 I never tried that you can try.

  • @user-qj6jb5vq1n
    @user-qj6jb5vq1n 4 месяца назад

    can i use this same things for production environment ? give me full details

  • @BurakGlobeMax
    @BurakGlobeMax 9 месяцев назад

    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

    • @shreelearning3698
      @shreelearning3698  9 месяцев назад

      You can go to dist folder and start running application on pm2
      cd ./dist
      pm2 start your-app.js --name your-app-name

    • @BurakGlobeMax
      @BurakGlobeMax 9 месяцев назад

      @@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.....

  • @DataTheory92
    @DataTheory92 Год назад

    Ma’am can you make videos on Jenkins

  • @stiphenrobert4469
    @stiphenrobert4469 Месяц назад

    Thank you so much 👍

  • @mrdecode9341
    @mrdecode9341 Год назад

    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 🙏🙏🙏🙏🙏🙏

    • @shreelearning3698
      @shreelearning3698  Год назад

      Okay sure

    • @shreelearning3698
      @shreelearning3698  Год назад

      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

    • @user-bb9oi9xk4v
      @user-bb9oi9xk4v Год назад

      Открой дверь

  • @baskardeepak3
    @baskardeepak3 Год назад

    09:05 actions
    20:15 action runner

  • @VinayKumarSupervisor
    @VinayKumarSupervisor Год назад

    Please create a video on nextjs with digital ocean CI/CD

  • @travelworld5889
    @travelworld5889 Год назад +1

    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

  • @GauravDeshwal-gj6uz
    @GauravDeshwal-gj6uz Год назад

    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?

    • @shreelearning3698
      @shreelearning3698  Год назад

      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.

    • @rishabhranjan5047
      @rishabhranjan5047 Год назад

      bro did you get an solution?

  • @AllInOne-cs3hp
    @AllInOne-cs3hp 5 месяцев назад

    i cant find _work folder inside action runner directory. help me out.

  • @bhaktiand_bhajan
    @bhaktiand_bhajan 9 месяцев назад

    How does it install all the dependencies from package.json ?

  • @mrdecode9341
    @mrdecode9341 Год назад

    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

    • @shreelearning3698
      @shreelearning3698  Год назад

      Thanks. I will upload with docker

    • @mrdecode9341
      @mrdecode9341 Год назад

      @@shreelearning3698 to fir mam aj hi kijie na plz 🙏🙏🙏🙏

  • @ouneetsethi3573
    @ouneetsethi3573 Год назад

    what is the tool you used for triggering the REST APIs from your system?

  • @debasishbehera7429
    @debasishbehera7429 Год назад

    make a tutorial for jenkins also

  • @harshitvarshney5899
    @harshitvarshney5899 6 месяцев назад

    not getting _work folder after starting also what's the issue ?
    great work 🔥🔥🔥🔥

  • @bhaktiand_bhajan
    @bhaktiand_bhajan 9 месяцев назад

    I have used prisma client as an ORM and expressJs for rest api, how to deploy that ?

    • @shreelearning3698
      @shreelearning3698  9 месяцев назад

      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

  • @imi9741
    @imi9741 3 месяца назад

    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?

    • @shreelearning3698
      @shreelearning3698  3 месяца назад

      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.

  • @KaranChauhan-fu6dy
    @KaranChauhan-fu6dy 10 месяцев назад +2

    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.

    • @shreelearning3698
      @shreelearning3698  6 месяцев назад +2

      You can create a .env file in server inside your application folder and use it.

  • @prasadlakshan5407
    @prasadlakshan5407 Год назад

    I have one question? How We manage .env file in those api. And thanks for the content.

    • @rishabhranjan5047
      @rishabhranjan5047 Год назад +1

      same question..did u get an answer?

    • @prasadlakshan5407
      @prasadlakshan5407 Год назад

      @@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

  • @hirentank9447
    @hirentank9447 Месяц назад

    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

  • @patelrinkal2500
    @patelrinkal2500 6 месяцев назад

    Mam abhi url http se start ho rahi he but use https me kese change kar sakte he

  • @user-ej4zr7vj7k
    @user-ej4zr7vj7k Год назад

    does github actions charges money on indiviual's private repository ?

    • @shreelearning3698
      @shreelearning3698  Год назад

      There are some minutes and storage is free to use GitHub hosted runners. Beyond that it may cost.

  • @rahulray736
    @rahulray736 Год назад

    Jenkins Alternative hai kya

  • @reactjs1900
    @reactjs1900 Год назад

    Runner getting stopped after , disk of system is full , how to deal it with

    • @shreelearning3698
      @shreelearning3698  Год назад

      You need to extend the storage in EC2. You can use Amazon Elastic Block Storage

  • @codewithrosharana
    @codewithrosharana 2 месяца назад

    SSL Bhi bta dete aap

  • @bhuvneshsharma8498
    @bhuvneshsharma8498 7 месяцев назад

    How can i manage my env file in deployment

    • @shreelearning3698
      @shreelearning3698  7 месяцев назад

      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

  • @Anurag_Dhrejen
    @Anurag_Dhrejen Год назад

    _work folder is not reflecting in my case on ec2

    • @MuhammadAbdullah-kl1em
      @MuhammadAbdullah-kl1em 11 месяцев назад

      same

    • @clinto_abraham
      @clinto_abraham 9 месяцев назад

      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.

  • @shamimakhtar5265
    @shamimakhtar5265 11 месяцев назад

    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 ...😢😢

    • @shamimakhtar5265
      @shamimakhtar5265 11 месяцев назад

      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 😔😔