-
Create a EC2 Instance from here
-
1. Click on Connect button near launch instance 2. Use any of the 3 options to connect your instance (browser-based ssh connection is pretty much easier than others)
-
-
Navigate to your working repository and Create a self hosted runner from Settings -> Actions -> Runners
- Select the environment where the runner is going to be install (select similar to EC2 instance Environment)
- Select the architecture
- Run all the commands shown in your EC2 instance created from #1
-
Create a S3 bucket from here and enable public access for the bucket
-
Create a ElasticBeanStalk Application from here
-
Create a IAM user for programmatic access from here and make sure whether it has all the below access:
- AWSS3FullAccess
- AWSEC2FullAccess
- AWSCloudfromationFullAccess
- AdministratorAccess-AWSElasticBeanstalk
These are predefined policies provided by AWS . We can also create our own policies based on the requirement
-
Once you done with creating IAM user you will get a ACCESS_KEY_ID and ACCESS_KEY (please store the
access_key
somewhere. you can't see the same access_key value again). Add those keys secretsSettings - > Secrets -> Actions
- In my case I have named
AWS_ACCESS_KEY_ID
for access_key_id andAWS_SECRET_ACCESS_KEY
for access_key
- In my case I have named
-
Create a directory named
workflows
inside.github
directory in root folder.
Looks Like├── .github │ ├── workflows │ │ ├── *.yaml // here goes all the github-action files ├── build ├── src
To know more about github actions
Click Here -
Copy the github-actions.yaml file from here to your workflows directory.
-
Config all the env values :
EB_APPLICATION_NAME: "YOUR_EBS_APPLICATION_NAME" created in #3 EB_APP_ENV_NAME: "YOUR_EBS_APPLICATION_ENVIRONMENT NAME" created in #3 DEPLOY_PACKAGE_NAME: "YOUR_APPLICATIO_NAME-${{ github.sha }}.zip" // make sure you have different package name for each deployment to keep track on your application version AWS_REGION_NAME: "YOUR_REGION" where all aws components are created AWS_BUCKET_NAME: "YOUR_BUCKET_NAME" created in #4
Note: make sure all the above AWS components are created in same region