1.Launch an EC2 instance on AWS runner spec:
a. Ubuntu
b. t2.medium
c. 30 gb size
-
Set the runner on EC2 with the commands mentioned in github runner
-
Create a yaml workflow
-
set the env variables under Secrets and variables
-
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
- 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
- login to the dockerhub using credentials
docker login