Skip to content

Created a github actions pipeline to deploy the website into ec2 server.

Notifications You must be signed in to change notification settings

HIMA10SHREE/CI_CD-MERN-Application-Using-GitHubAction

Repository files navigation

CI_CD OF MERN APPLICATION USING GITHUB ACTION

Screenshot (173)

1.Launch an EC2 instance on AWS runner spec:

 a. Ubuntu
 
 b. t2.medium
 
 c. 30 gb size
  1. Set the runner on EC2 with the commands mentioned in github runner

  2. Create a yaml workflow

  3. set the env variables under Secrets and variables

  4. In the EC2 install docker

##Install in Amazon Ubuntu
#!/bin/bash
sudo apt update -y

sudo apt install apt-transport-https ca-certificates curl software-properties-common -y

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable" -y

sudo apt update -y

apt-cache policy docker-ce -y

sudo apt install docker-ce -y

#sudo systemctl status docker

sudo chmod 777 /var/run/docker.sock
  1. Install node version 18 or above
  curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh
  curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
  source ~/.bashrc
  nvm list-remote
  nvm install v18.18.0
  node -v
  1. login to the dockerhub using credentials
docker login

8.open the security ports Screenshot (165)

  1. run the runner Screenshot (166)

10 run the security codeql Screenshot (169)

Screenshot (170)

Screenshot (172)

  1. the website is running to the port 3000 Screenshot (167)

About

Created a github actions pipeline to deploy the website into ec2 server.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published