CI/CD — Docker-Compose, Elastic Beanstalk, and Github Actions

Continuous Integration and Continuous Deployments creates and environment of less bug by running test against all commits to a codebase.


Setting up Github Actions

name: Push images to Dockerhub and deploy on ELastic Beanstalk
- master
name: build docker images
runs-on: [ubuntu-latest]
- name: checkout
uses: actions/checkout@v2
- name: Docker Login
uses: docker/login-action@v1.8.0
username: ${{secrets.DOCKERHUB_USERNAME}}
password: ${{secrets.DOCKERHUB_TOKEN}}
logout: true
docker build -t keithkfield/blog-server . 
docker tag keithkfield/blog-server keithkfield/blog-server:latest
docker push keithkfield/blog-server:latest
- name: Build Server image
run: docker build -t keithkfield/blog-server -f
./Server/Dockerfile ./Server
- name: Tag our Image
run: docker tag keithkfield/blog-server
- name: Push to dockerhub
run: docker push keithkfield/blog-server

Using AWS

- name: Deploy to EB
uses: einaregilsson/beanstalk-deploy@v14
aws_access_key: ${{ secrets.AWS_ACCESS_KEY }}
aws_secret_key: ${{ secrets.AWS_ACCESS_SECRET_KEY }}
application_name: medium-compose-series
environment_name: Mediumblogseries-dev
version_label: "app-cbe0-210131_121135"
region: us-east-1

Creating Elastic Beanstalk App

eb init -r <region> <application_name>
Process of creating app
Select a platform branch.
1) Docker running on 64bit Amazon Linux 2
2) Multi-container Docker running on 64bit Amazon Linux
3) Docker running on 64bit Amazon Linux
eb create <enviorment-name> 

Put Together

eb appversion

Activating the Flow

Initial Push

Software Dev

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store