Blog 1 Sp21

Blog 1-SP21

Setting Up a Workflow With Github Actions

Previously we went over a general overview of Github Actions. Now it’s time to do demonstrate Github Actions… in action lol. Today, or whatever time and day you’re reading this blog, we’ll be setting up CI with Github Actions.

Overview: CI - Continuous Integration

CI is obviously the 1st part of the CI/CD pipeline workflow used in many development teams. CI stands for continous integration. It is essentially, when devlopers push the code to a code repository, a testing or build server checks the code as soon as it’s pushed, then the devloper get’s feedback about those tests. It allows you to find errors and bugs early.

Demo Time

In this example we’ll be assuming that our project already has a project repository in Github with a Dockerfile to then get our docker image, and that AWS ECR is already setup.

First

Create a configuration file. Since we’re working with AWS, we’ll call it “aws.yml”. This file will be used to trigger the conintuous intergration pipeline. The file will be placed in you project repository, at .github/workflows/ .

Second

Fill in that file with the proper syntax. Since it’s YAML it’s pretty straight forward. We’ll start with What triggers it? What event will it be? What this is indicating is that this workflow will trigger ON pushes and pull requests on the master branch. It’s not rocket science. Markdown is quite an easy language.

Third

We’ll be doing the action, or in this case the ‘job’ now. Again with the syntax being so simple, I’ll explain what’s going on. This code can be broken down into 3 main parts…

  1. name: Configure the AWS credentials
  2. name: Login in to the AWS ECR
  3. name: Build, Tag, and push the Image to the AWS ECR

Written on February 26, 2021