thanks for the guide its working but i want to ask do we really have to delete the whole project and recopy it everytime we push what if project is big and change is very small do we still have to do the same process or there is any other efficient way
Hi In GitHub action, "rsync" command can be used instead of "src" (line 37 of deploy.yaml):- rsync -avz --delete ./ $EC2_USERNAME@$EC2_HOST:/var/www/langchain-app After that "sudo mv * /var/www/langchain-app" command from bash script can be removed:- github.com/TrickSumo/langchain-course-python/blob/16-CICD-PYTHON-WEBAPP/deploy.sh#L10
No, env variables are stored as GitHub repo environment secret. ua-cam.com/video/W8tONeBuTn0/v-deo.html These secrets are used to create .env file dynamically. So your keys are never exposed publically.
Home Work hint => 1. To get instance IP address in the bash script, use:- curl 169.254.169.254/latest/meta-data/public-ipv4 (make sure to do:- EC2 instance >> Instance settings >> Modify instance metadata options >> IMDSv2 >> Optional) 2. Use "sed" Linux command to search and replace IP address in the "index.html"
thanks for the guide its working but i want to ask do we really have to delete the whole project and recopy it everytime we push what if project is big and change is very small do we still have to do the same process or there is any other efficient way
Hi
In GitHub action, "rsync" command can be used instead of "src" (line 37 of deploy.yaml):-
rsync -avz --delete ./ $EC2_USERNAME@$EC2_HOST:/var/www/langchain-app
After that "sudo mv * /var/www/langchain-app" command from bash script can be removed:- github.com/TrickSumo/langchain-course-python/blob/16-CICD-PYTHON-WEBAPP/deploy.sh#L10
Does this require you to push the generated .env file to your github repo?
No, env variables are stored as GitHub repo environment secret. ua-cam.com/video/W8tONeBuTn0/v-deo.html
These secrets are used to create .env file dynamically.
So your keys are never exposed publically.
Home Work hint =>
1. To get instance IP address in the bash script, use:-
curl 169.254.169.254/latest/meta-data/public-ipv4
(make sure to do:- EC2 instance >> Instance settings >> Modify instance metadata options >> IMDSv2 >> Optional)
2. Use "sed" Linux command to search and replace IP address in the "index.html"