Auto Deploy Nodejs Rest API on AWS EC2 | CI/CD pipeline using GitHub Actions

Поделиться
HTML-код
  • Опубликовано: 25 май 2023
  • Hello everyone! In this video, we will set up automatic deployment of Nodejs Rest API on AWS EC2 instance using GitHub Actions
    The API was built using Express ( Node.js framework ) and MongoDB Atlas which is a NoSQL cloud database platform.
    You'll learn How to:
    ➤ Login to the AWS console and create an EC2 instance
    ➤ Setup GitHub Repo and Push your project
    ➤ Login to EC2 instance using Windows Powershell as well as PuTTY
    ➤ Setup GitHub Action runner on the EC2 instance
    ➤ Create GitHub Secrets for managing environment variables
    ➤ Create CI/CD Workflow using GitHub Action
    ➤ Install nodejs and nginx on the EC2 instance
    ➤ Install pm2, a process manager for Node.js production applications
    ➤ Configure nginx and how to restart it
    ➤ Run backend node.js rest api built using the express framework in the background as a service using pm2
    ➤ Add the command in yml script of the project to restart the nodejs api server after every push to the repo
    ➤ Support me by COMMENT, LIKE, SUBSCRIBE, and SHARE
    ➤ Channel link - / @webwizard8
    ➤ Music Licence:
    Song: Atch - Freedom
    Music provided by Vlog No Copyright Music.
    Creative Commons - Attribution 3.0 Unported
    Video Link: • Atch - Freedom (Vlog N...
    Song: Hotham - Find
    Music provided by Vlog No Copyright Music.
    Creative Commons - Attribution 3.0 Unported
    Video Link: • Hotham - Find (Vlog No...
    Song: LiQWYD - Sweet
    Music provided by Vlog No Copyright Music.
    Creative Commons - Attribution 3.0 Unported
    Video Link: • LiQWYD - Sweet (Vlog N...
    Song: LiQWYD - We've Got Time
    Music provided by Vlog No Copyright Music.
    Creative Commons - Attribution 3.0 Unported
    Video Link: • LiQWYD - We've Got Tim...
    #autodeploy #nodejsrestapi #awsec2 #cicd #githubactions #restapideployment #nodejsdevelopment #awsec2deployment #githubactionstutorial #nodejsexpress #deployrestapionec2 #awsec2cicd #githubactionspipeline #restapiawsec2 #deployrestapi #cicdpipeline

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

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

    GitHub Repo - github.com/kalyansaxena/nodejs-restapi-ec2
    GitHub Actions - github.com/features/actions
    AWS Management Console - aws.amazon.com/console/

  • @pulsechainalltheway1845
    @pulsechainalltheway1845 17 дней назад +1

    This is amazing, I have been looking for a video that properly explains the whole process of deploying a Nodejs app with a CI/CD pipeline using GitHub actions. Thanks a lot.

  • @nehjain
    @nehjain 2 дня назад

    Great Video, lots of information, I was exactly looking for this! 😍

  • @patshalaaa
    @patshalaaa 3 часа назад

    Awesome bhaii.....subscribed

  • @MayankMishra-oy5xe
    @MayankMishra-oy5xe 5 месяцев назад +1

    Very well structured and clean explanation. Please do continue to make these kind of videos. Good luck. You got a subscriber !

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

    WOW!!! You are the best man!. Thank you so much, you nailed it.

  • @ibadshaikh2215
    @ibadshaikh2215 6 дней назад

    Thanks alot for this amazing video!

  • @UditNagar-of5su
    @UditNagar-of5su 5 дней назад

    Best Resource...Thanks sir ❤❤

  • @shyam-bh
    @shyam-bh 4 месяца назад +1

    After researching and viewing so many resources, this is what i was looking for, thank you so much for this video. Keep posting such videos.

  • @breezycodes
    @breezycodes 5 месяцев назад +1

    Wow.. i have been doing env variable loading wrong all along 😂😂😂.
    Thank you. I never thought about doing it this way

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

    Loved it ❤️👍

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

    Clean Explanation thanks!

  • @huzaifa_a4602
    @huzaifa_a4602 4 месяца назад

    Thank you, it was a wealth of knowledge. 😁😊

  • @AshenSandeep-jc5iw
    @AshenSandeep-jc5iw 9 дней назад

    well explained. easy to deploy ,

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

    Excellent Explanation brother

  • @ok.tanmay
    @ok.tanmay 2 месяца назад

    thanks for the tutorial it helped a lot

  • @user-xe3lf3cx1q
    @user-xe3lf3cx1q 22 дня назад

    This is the best video i have ever seen on this topic keep growing brother

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

    Very clear explanation - well done and thank you!

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

      Thank you, Glad it was helpful!

  • @MOSELEY_DEV
    @MOSELEY_DEV 12 дней назад

    Thanks man!

  • @user-ov7nb9um8b
    @user-ov7nb9um8b 3 месяца назад

    Kudos brother. Keep up the good work.

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

    Thank you very much ,for sharing this content . It saved me lot of time and have gained lot of knowledge.

  • @uvaishassan
    @uvaishassan 9 месяцев назад +2

    I spent hours searching for help on this exact thing, this was the only video that left me satisfied. Thanks for the video

    • @webwizard8
      @webwizard8  8 месяцев назад +1

      I'm glad that the video met your needs and left you satisfied! Your kind feedback motivates me to create more content. Thanks for watching and for your support! 😊

  • @dineshindn4404
    @dineshindn4404 15 дней назад

    great work

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

    Hi bro, Loved your explanation on this video. Thank you soo much for this content. Please make more videos, Don't stop it

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

    It was the best video ever for this. I followed every step of yours. whenever I have to modify something according to my need I just ask chat-gpt. Thanks a lot!

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

      Thank you for your kind words!! I'm really happy that it helped you!

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

    Thank you so much.

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

    Amazing video

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

    Thank you. Good video with good explanation

    • @webwizard8
      @webwizard8  8 месяцев назад +1

      You're welcome! I'm glad you found the video and explanation good

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

    thanks a lot man!!

    • @webwizard8
      @webwizard8  9 месяцев назад +1

      You're welcome! I'm glad you enjoyed the video. Explore the channel for more content and consider subscribing!

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

    thank you, very helpfull

    • @webwizard8
      @webwizard8  9 месяцев назад +1

      You're welcome! I'm delighted to hear that you found the video helpful. Explore the channel for more content and consider subscribing!

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

    Thank you so much

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

      You're welcome! I'm glad you enjoyed the video. Explore the channel to find more content!

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

    Thank u bro ..

    • @webwizard8
      @webwizard8  8 месяцев назад

      You're welcome! Thank you for watching!

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

    thanks a lot bro

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

      You're welcome! I'm glad you enjoyed the video. Consider subscribing to the channel to get more content like this, Your support and feedback mean a lot to me!

  • @LeulDam
    @LeulDam 9 месяцев назад +1

    Thank you for this, can you also show how to do this with auto scaling running multiple ec2 instances?

  • @Infinite_Mainak
    @Infinite_Mainak 5 месяцев назад +1

    Plz zoom a little bit...there r many mobile viewers... overall video is good ❤

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

    How can i have different stages for the above ?
    For example I have 2 ec2 instances and I have configured runners on both of them. One for staging and one for production.
    How can i do it?

  • @king-virat-kohli
    @king-virat-kohli 4 месяца назад

    Hi, I want to store the .env values in the github secreat. And then i want them to pull them to the docker. Which i am only able to do it for the first key value pair stored in the github secreat. I can load multi values from it. Can u help me out here?

  • @Trying_hard_to_become_rich
    @Trying_hard_to_become_rich 20 дней назад

    sir can we do the same process for MERN stack application deployment and if i changed the source code and again i merged with the existing code in the github means will the application already deployed in the ec2 also change simultaneously or we need to restart the server? i'm a student sir please reply for this question. And i wants to reach you personally is there any possible way to contact you?

  • @user-ti1wi9fk4w
    @user-ti1wi9fk4w 3 месяца назад

    hi great video, But how can we do this for 3 different environment ie, development, production, qa on aws

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

    Hi
    Is it possible to create the action using other branch?

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

    can we use the same instructions on ubuntu instance ?

  • @bishnudev1760
    @bishnudev1760 8 месяцев назад +1

    Thanks for the tutorial buddy ❤ I have deployed my Express server into AWS EC2 but it’s on http port and getting security issue in Frontend. Can you please make a video on how to change it to https ? Would be helpful 😊

    • @UptimeUnicorn
      @UptimeUnicorn 8 месяцев назад

      you need to install install certificate on a application load balancer, then use SSL termination. ur EC2 will get a SSL. make sure to use route53 and AWS ACM to help u

  • @user-ie7mj3cu3l
    @user-ie7mj3cu3l 5 месяцев назад

    Hey I have been setuped all the things but I'm unable to connect api I'm getting 404 error
    can you help me any of one

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

    Please how to auto deploy laravel rest API on AWS EC2 | CI/CD pipeline using github Actions and apache

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

    can you make a video on using mysql

  • @sc-nc6bb
    @sc-nc6bb 4 месяца назад +1

    There will be some command equivalent to docker compose -logs to see the errors of the app on the server ?

    • @webwizard8
      @webwizard8  3 месяца назад +1

      you can use PM2's built-in logging functionality to view logs. For example, you can use the "pm2 logs" command to tail the logs in real-time.

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

    We neet to download Ubuntu in Laptop?

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

    How to make this http api request with https

  • @mohammadabid9520
    @mohammadabid9520 4 месяца назад

    Hey I have been set-up all the things as per your guideline but I'm unable to connect api, I am getting 404 error
    can you help me any of one

    • @webwizard8
      @webwizard8  4 месяца назад

      404 means not found error
      You need to verify the route has been implemented in your api

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

    before i used github action and self hosted runner, i manually push my repo to my server. so currently i start using it and now i have issue where after the workflow fully deployed, the file has been changed inside _work file, but my server is running at my home directory, how to solve this?

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

      did you configured nginx web server? see the video where I've showed nginx configuration, this might help
      the role of using github actions workflow is to clone our github repo into _work folder whenever a change made to our github main branch
      once the repo is available inside _work then its our responsibility to make use of web server like nginx and redirect requests to the localhost port
      pm2 plays role for starting and restarting your express server

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

      @@webwizard8 so i have to pm2 start the nodejs file inside my _work folder? In my nginx, i configured it to detect /api/ and also my react build file that has been placed in /var/www/html, do i have to change this?

  • @sujjee
    @sujjee 8 месяцев назад +1

    what is diff between jenkins and github actions?

    • @webwizard8
      @webwizard8  8 месяцев назад +1

      Jenkins and GitHub Actions are both tools used in the continuous integration and continuous deployment (CI/CD) process.
      Jenkins is an open-source automation server that allows building, deploying, and automating projects. It's highly customizable and has been in the market for a longer time, offering a wide range of plugins and integrations.
      On the other hand, GitHub Actions is a newer offering by GitHub that is tightly integrated with the repository. It allows you to automate tasks directly from your GitHub repository. It's well-suited for projects already hosted on GitHub and simplifies the CI/CD setup with its YAML-based workflows.

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

    Hi bro very nice video but can you help me ????
    when i on pm2 start i recive 502 gatway error message and I can't fix it,,, i dont understand it .. please help me ???

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

      If nginx is having problem reaching out to the web server then you'll encounter 502 bad gateway error
      So culprit would be your express server
      make sure to run pm2 start command inside your repo folder where server.js file exists
      observe the video from 30:45 onwards

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

    Could you do a video on how to implement docker for this process?

    • @webwizard8
      @webwizard8  10 месяцев назад +2

      Thanks for your comment and interest in the video! I'll definitely consider creating a tutorial on implementing Docker for this process. Stay tuned for updates on my channel!

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

      @@webwizard8 Sounds great, thank you!

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

      @@tomhardy7734 mean time I'd recommend watching this video - ruclips.net/video/YDNSItBN15w/видео.html

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

    SSL kese kre bolo bhia

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

    how can I start my Next.js project using pm2 command?

  • @marklouiedullavin4668
    @marklouiedullavin4668 4 месяца назад

    bakit parang malungkot ka?

  • @idelsoldier2825
    @idelsoldier2825 9 месяцев назад +1

    I am not getting _work folder

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

    I want make https request how to implement that,i have a https setup in my node server,since i am developing a mobile app i used https requests

  • @reactjs1900
    @reactjs1900 11 месяцев назад +2

    These runners are getting stopped after some days

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

      Hi, Thanks for bringing up to the notice, I'd recommend going through this docs once - docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners#usage-limits

    • @user-gy5gl1od1j
      @user-gy5gl1od1j 8 месяцев назад

      @@webwizard8 hey I have a question if this self hosted runners and workflows are stopped after a certain time does this effect on my application which is in aws

    • @reactjs1900
      @reactjs1900 8 месяцев назад

      @@user-gy5gl1od1j
      It will not affect you application, but new pushes will not be reflected there.