Ida  Nader

Ida Nader

1601376600

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.

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

Buddha Community

Automate Application Deployment Using Github Actions
Ida  Nader

Ida Nader

1601376600

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.

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

A Simple Guide to Github Page Deployment

Long story short: Jekyll is a template engine changing

markdowndocuments on staticHTMLwebpages, that you can then host anywyere, because you don’t need databases or server that has PHP or Python.

Usual Process

Normally the process of adding new post looks like this:

  • I write markdown document with setting parameters like title, date and tags
  • when I’m happy with what I wrote (never), I commit changes and push it to repository on GitHub. Repository name comes from my nick and is also address for blog asvid.github.io
  • Github after pushing to branch master builds website from sources using Jekyll - probably something like running jekyll build
  • result of Jekyll build is not present in a repository, but you see it right now after visiting bloga page

#github-pages #github-page-with-jekyll #jekyll #github-actions #github #deployment #continuous-deployment #web-development

Oral  Brekke

Oral Brekke

1617437520

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.

This article is more focused on how you can use the GitHub actions and how easy it is to deploy your code to GitHub pages rather than the portfolio site code.So every time you make an update or build to your website ,the changes are automatically reflected and this automated deploying process makes work much faster.

The way GitHub action works is you create actions in your repositories by creating one or more yaml files and these are called workflows.Workflows now can handle build tasks like CI CD. This means you use the action to test your code and push the site to the desired hosting platform (in this case GitHub pages ) when the main branch changes .

First step assuming that you have a GitHub account is to create a repository having your website code in it.Now I have a bootstrap website but in the future I do plan on adding node JS so I already added package.json.

#workflow #portfolio #github #github-actions #github-pages

Desmond  Gerber

Desmond Gerber

1624347085

How to Create a Custom GitHub Actions Using JavaScript — Beginner Level

In this blog, we are going to learn how to create our own custom GitHub action using javaScript.

Prerequisite

  • Basic JavaScript Knowledge
  • Basic Git & GitHub Knowledge

About GitHub Actions

Automate, customize, and execute your software development workflows right in your repository with GitHub Actions. You can discover, create, and share actions to perform any job you’d like, including CI/CD, and combine actions in a completely customized workflow.

Types of Actions

There are three types of actions: Docker container actions, JavaScript actions, and composite run steps actions.

JavaScript Custom Action

Let’s create a Custom GitHub Action using JavaScript by creating a public repo, once the repo is created, we can clone it to our local machine using VS Code or GitPod. You need to have Node.js 12.x or higher and npm installed on your machine to perform the steps described here. You can verify the node and npm versions with the following commands in a VS Code or GitPod terminal.

node --version 
npm --version

#github #github-tutorial #github-actions #github-trend

How to deploy a React app to Firebase using GitHub Actions

GitHub Actions provide a way to automate pretty much anything you want to do with your repository. It can be used to automatically test your project every time you make a pull request or push some code to it, or maybe to publish something to GitHub Packages every time you make a release. The possibilities are endless.

So, in this article, I’m going to walk you through the most obvious functionality of GitHub Actions: deploy your application to production in an automated fashion, so you never have to do it manually again.

What are we going to do exactly?

Keeping in mind that the goal of this tutorial is the deployment, not the application being deployed, we are going to set up a React application using only the template that is already provided when you set up a React app, with a few modifications to make it a little more personal.

Then, we are going to set up a project on Firebase and extract some credentials so we can use the Hosting functionality to eventually — guess what? — host our application and make it available in the internet.

Finally, we will write our workflow file, commit it to GitHub, sit back, and watch the magic of automation happen right before your eyes.

Set up a React app

This section might be unnecessary for the majority of the readers, but I’ll keep it here for those who maybe never dealt with React before and want a glimpse of this beauty. If this is like eating a candy to you, please jump to the next section.

Then buckle up, snap your fingers, and go through the following steps:

  1. Make sure you have NPM installed locally (instructions here)
  2. Make sure you have NPX installed locally:
npm install -g npx

3. Open a terminal of your choice, select a folder where you want your project to live, decide on a name for your project (I’ll use awesome-app for this tutorial), and use NPX to build your application’s template:

npx create-react-app awesome-app

4. Go grab some coffee while everything is being set up, then return to your desk, move into the recently created awesome-app folder and start the application with the following commands:

cd awesome-app
npm start

Wait for it and… Awesome! You now are the proud owner of a website! Right there running in your browser with the animated React logo and all. This is sufficient for the purposes of our demo, but go ahead and edit src/App.js to something more personal, if you so desire. Being a cat person, mine looks like this

#firebase #automation #react #deployment #github-actions