GithubActions-Projects
Narendra N
2 min read
Note:
1. Tic-Tac-Toe Game deploy on EKS through Github Actions
Create 1st EC2(ubuntu 22.04, t2.large) and attach IAM(Admin access or EC2+S3+EKS Full accesses) Role
Install Docker & run sonar container, access sonar(9000) and run script.sh(JDK17 + Trivy + Terraform + Kubectl + awsCLI + nodejs)
Create New project in sonar and choose Github Actions and proceed as shown there
Add sonar-token, sonar-server creds in Github Actions secrets and variables section
copy the pipeline script of sonar into .github/workflows/build.yml file in github repo and add sonar-project.properties file also into github repo
on above EC2, create setup Github Actions self-hosted runner by using commands shown in Github Actions runners section
Next clone the Github repo and run terraform commands(init, plan, apply) in main.tf's folder to create EKS setup
create s3 bucket(backend.tf), Next add pipeline script other stages(npm install, trivy filescan, docker build & push, ImageScan, Deploy[dockerpull, Image scan, deploy-Container, update kubeconfig, deploy-k8s, Slack])
Next run Build and access the Game by Load Balancer DNS link by kubectl get all on EKS Node's EC2
Next by terraform destroy on 1st EC2, clear the whole EKS setup and later delete kube deploy files also
2. Netflix App deploy on Docker Container through Github Actions
Create 1st EC2(ubuntu 22.04, t2.large) and attach IAM(Admin access or EC2+S3+EKS Full accesses) Role
Install Docker, Trivy & run sonar container, access sonar(9000)
Create New project in sonar and choose Github Actions and proceed as shown there
Add sonar-token, sonar-server creds in Github Actions secrets and variables section
copy the pipeline script of sonar into .github/workflows/build.yml file in github repo and add sonar-project.properties file also into github repo
on above EC2, create setup Github Actions self-hosted runner by using commands shown in Github Actions runners section
Next add pipeline script other stages(Trivy filescan, docker build & push, Deploy[dockerpull, Image scan, deploy-Container])
Next run Build and access Netflix App in browser above EC2:8081 port
Note: here in docker build stage, TMDB API key in needed
3. Deploy Web-App on S3 through Github Actions
Created Github Repo with needed code files and next added aws access keys to this Repo in secrets variables.
Created S3 bucket (static website hosting enabled and needed bucket accessing policies)
Prepared Github Actions Workflow yaml file to push code files to s3 bkt and host the website on it.
Run the above yaml file and accessed website through S3 end point link.
Next added it route53 domain records and accessed the same with our custom domain name. [here used Managed runner, not self-hosted runner]
gfdhgf
dsgsh
Note:
0
Subscribe to my newsletter
Read articles from Narendra N directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by