Automate Application Deployment Using Github Actions

Automate Application Deployment Using Github Actions

GitHub Actions makes it easy to automate all your software workflows. You can build, test, and deploy your code right from GitHub. In this post we will explore how you can use GitHub Actions to automate serverless application deployment on AWS. You can also use AWS's own CI/CD services to achieve the same. But here we are going to keep our discussion limited to GitHub Actions.

GitHub Actions makes it easy to automate all your software workflows. You can build, test, and deploy your code right from GitHub. In this post we will explore how you can use GitHub Actions to automate serverless application deployment on AWS. You can also use AWS's own CI/CD services to achieve the same. But here we are going to keep our discussion limited to GitHub Actions. 

How to Use GitHub Actions?

Creating a GitHub action is simple. Go to your GitHub repository that you want to automate and click on "Actions"

You will be taken to Actions page where you can create a new Blank workflow or select existing actions from the marketplace. The actions from marketplace are reusable actions that you can use in your workflow. We are going to create a blank action and we will also use some actions from marketplace. 

Let's rename the YAML file to workflow.yml. You can name anything you like. We are going to create a Lambda function with API gateway in Serverless Application Model (SAM) template and deploy it using GitHub Actions. Below is our SAM template. 

YAML

AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: 
  GitHub Actions demonstration App
Resources:
  ApiGatewayApi:
    Type: AWS::Serverless::Api
    Properties:
      StageName: Prod
    Auth:
     UsagePlan:
      CreateUsagePlan: PER_API
      Description: Usage plan for this API
      Quota:
       Limit: 500
       Period: MONTH
      Throttle:
       BurstLimit: 100
       RateLimit: 50
  LamdbaFunction:
    Type: AWS::Serverless::Function
    Properties:
      CodeUri: ./    
      Handler: lambda.handler
      Runtime: python3.8
      Events:
        getCounter:
          Type: Api
          Properties:
            Path: /hello
            Method: get
            RestApiId: !Ref ApiGatewayApi

lambda.py

aws automation deployment automation github actions how-to guides

What is Geek Coin

What is GeekCash, Geek Token

Best Visual Studio Code Themes of 2021

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

A Simple Guide to Github Page Deployment

Long story short: Jekyll is a template engine changing markdown documents on static HTML webpages, that you can then host anywyere, because you don't need databases or server that has PHP or Python.

Deploy using Github Actions on AWS Elastic BeanStalk

In this article I’d be going through the process of deploying Node application on AWS Elastic BeanStalk using Github Actions.

Automating Localization with Github Actions: A How-To Guide

Automating Localization with Github Actions: A How-To Guide. Setup fully automated localization for your project once and forget about all the hassle forever. It's fun with Github Actions! And as we are going to use Github Actions, it’s gonna be fun!

Deploying my portfolio website on Github Pages using Github Actions.

Deploying my portfolio website on Github Pages using Github Actions. I recently deployed my portfolio site and wanted to try out github actions and this is my experience of automating the deployment.

Lights — Camera — {Github}Action: Deploy a Azure function using Github actions

Lights — Camera — {Github}Action: Deploy an Azure function using Github actions. A short tutorial on how to deploy an Azure function using github action. As we know, GitHub Actions help us automate tasks for example. We will create a simple Github Action to deploy an HTTP Trigger Azure function to Azure Function App.