As promised, this article will be about my first assignment given to me from my mentor in the SCA Devops Mentorship Channel.
As the article title suggests, my task was to deploy a project (I am using python since that is the language I am very familiar with) using GitHub Actions to an AWS EC2 instance. Below are what I did and the resources to what I have setup so far
Create a flask application that counts the number of times the page has been visited.
Using AWS Free tier, setup an EC2 instance.
Setup GitHub actions to login to the instance, install the necessary python packages and start the app
Later created a systemd service that starts the application when the EC2 instances started.
One thing I later found was that the public IP address for the EC2 instance changes when it starts anew. So got an Elastic IP which does not change anytime the instance restarts.
What more can be done? I am thinking mapping the IP address to a domain name as remembering IP addresses is tiring.
It is great to see how all of these have come together and I am looking forward to feedback and improvements I will make to the project
Resources:
You application will be accessible on the EC2 Public IP:5000, an example is below
http://13.51.124.194:5000/
GitHub Action:
https://github.com/maryjonah/SCA_Devops_Python_Project/blob/master/.github/workflows/action.yml