cicd

How to setup CI/CD with GitHub Actions for a React App with AWS EC2?

Here’s a tutorial on how to create a simple CI/CD with GitHub Actions for deploying React applications. Getting started GitHub Actions allows you to automate, customise, and execute software development workflows right in your GitHub repository. A workflow is a configurable automated process made up of one or more jobs. You can configure your workflows to run when specific activity on GitHub happens, at a scheduled time, or when an event outside of GitHub occurs. The workflow configuration is defined by a YAML file. GitHub provides preconfigured workflow templates. Before we start on setting up the actions Github would require a few secrets to identify the EC2 instance. Seeking the secrets First, on your React App GitHub repository, navigate to the main page of the repository, click Settings. Inside settings you’ll find actions which will contain repository secrets. These secrets are encrypted environment variables that we create in an organization repository, or repository environment. Now is the chance to get back to our EC2 Dashboard to the respective instance and get the details for the instance in which we are going to deploy. You can visit this to see how to setup EC2 instance for React Apps We’ll start with the basics and define the host machine i.e IP of the instance. Click on the new repository secret and fill in the values.. Refer to the following table on how we do it. DEPLOY_HOST Public IP of your EC2 instance DEPLOY_KEY Copy paste the content from your pem file DEPLOY_PORT 22 DEPLOY_TARGET Location for the folder in which files will be stored in the instance DEPLOY_USERNAME ssh username for your instance A small tip here, if you are deploying in the home location of your instance path to it would be /home/ubuntu/folder_name if you are on an Ubuntu Instance. Defining the workflow process Then, you’ll see suggestions of CI templates that are the best fit for your project. You can use workflow templates as a starting place to build your custom workflow. In this case, click Set up this workflow, under the name of the template NodeJS. Setting up the Workflow Now there are two ways you can go around, you can choose from a predefined template provided by Github or set up your own workflow. In this tutorial we are going to set up our own workflow. And don’t worry we’ll share our workflow here as well. You can use this workflow code: name: Build React Files & Deploy to EC2 amazon There are 2 events that trigger the workflow on push or pull request. The virtual environment used to run the workflow is an Ubuntu machine in the latest version. In the steps section, 2 actions and 3 NPM scripts are being used. The first action actions/checkout@v2 is a standard that you must include in your workflow before other actions when your workflow requires a copy of your repository’s code. The second one, as the name suggests, it is a set up for Node.js, as you can see, the set up is made in different versions of Node.js, through an array with all the versions used. After adding the deploy command on your workflow, click Start commit, and click Commit new file. After commiting the code the pipeline should start running and it will start deploying the application. You can see the status of your workflow in the Actions tab And the status of your workflow will be shown there. Happy Coding 🙂 To learn more about the importants of CI/CD, do check out our blogs: https://nyxwolves.com/ci-cd-pipelines-for-development-businesses-post-corona/ https://nyxwolves.com/web-development/ways-ci-cd-can-increase-your-productivity/   References: · https://github.com/features/actions

Read more
CI/CD

How CI/CD Pipelines for Development Businesses Can Survive in a Post-Corona Economy

If your company is considering moving to continuous integration and delivery (CI/CD) style of software development, the first question you may have is if this is a smart idea.  Shifting and training your employees will require time and money, but it’s not always apparent what the benefit will be or when you’ll see any return.  It’s understandable to be cautious and not jump on board with whatever the latest term is.  CI/CD has also demonstrated its worth not only in terms of speed—which isn’t a criterion of success in and of itself—but also in terms of delivering tangible business value, such as reducing time to market for new applications, features, and services, and enhancing KPIs. That is why corporate decision-makers must look past the hype and gain a thorough understanding of what CI/CD is and what it can provide a company. That way, there will be maximum buy-in throughout the organization, not only in IT and operations.  Let’s take a look at some of the benefits of CI/CD pipelines to help your firm decide whether or not to invest in them. But trust me, I have got something for you. Ensure high-quality code The most important reason to conduct DevOps is to improve code quality, and CI/CD is, of course, the most important procedure for DevOps teams. Because CI/CD pipelines include test automation, developers can learn about code issues almost immediately. Teams don’t waste time or resources on defective code, and developers aren’t bombarded with constant “fix” requests after they’ve moved on to other projects, thanks to the concept of “failing quickly.” Time is saved, money is saved, and engineers aren’t wasting their time switching between contexts… win, win, win.  Streamlined rollback A CI/CD pipeline allows developers to fail quickly and recover even more quickly. Pushing code into production is a simple procedure, and if there are any problems, you can easily roll it back. The ability to quickly roll back code saves time, energy, and resources for teams, and leads to speedier bug repairs.  Regular update ad feedback A DevOps platform with a single CI/CD workflow allows everyone on the team – including business stakeholders – to understand what’s going on, where it’s heading, and what might be going wrong. This may appear to be a basic concept, yet a single window into application development is quite groundbreaking.  Previously, there were so many tools in use that a project manager would have to look in multiple places and ask multiple people for progress updates. Developers and operational professionals did not fare much better. That was a waste of time and resources, especially when issues developed.  Transparency and accountability at their best A CI/CD pipeline makes the overall software development process perfectly transparent to the corporate side thanks to constant feedback. Product managers can see the status of a project at a glance and keep track of accountability as needed.  Enhanced Mean time to resolution (MTTR)  DevOps teams can quickly identify and resolve issues thanks to the insight afforded by a CI/CD pipeline. A major development statistic, mean resolution time, or MTTR, is based on the capacity to quickly fix problems. The faster the MTTR, the more effectively the DevOps team works and the faster software can be delivered; in other words, MTTR has a significant impact on the bottom line of a company. Shift to CI and CD to boom your business! Developers who notice how easy it is to iterate the software will be ready to suggest improvements or report any undesirable behavior before it reaches a client.  As many businesses have learned, a strategic shift to CI/CD can result in more overall innovation, as well as improved communication and efficiency across the board. Which, in turn, provides you with a competitive advantage.

Read more

Ways CI/CD Can Increase Your Productivity

Okay, let’s get this complexity broken into pieces to understand that the modern DevOps teams need an effective continuous integration (CI) and continuous delivery (CD) pipeline to keep up with the fast-changing technology landscape. If you know the agile concepts, it aids in a promising CI/CD pipeline that may shorten the software development life cycle, resulting in higher-quality software that is delivered faster.  If you are ever wondering how CI and CD work, then it is simple to say that CI/CD pipeline’s primary purpose is to automate the software development lifecycle (SDLC).  From creating code and performing tests to delivery and deployment, the pipeline will encompass many phases of the software development process. A CI/CD pipeline incorporates continuous monitoring and automation into the development process. A CI/CD pipeline integrates all stages of the software development life cycle and encompasses all software development life cycle stages.  You know why software companies go to this? It reduces the number of manual tasks for the development team, resulting in fewer human errors and faster outcomes. All of this contributes to the delivery team’s increased productivity. And Yay!  So, the Continuous Integration (CI) is automatically detected, pulled, built, and does unit testing as source code is changed for a product (the continuous process).  For better understanding and utilization the main goal of CI is to quickly make sure a new change from a developer is “good enough” and suitable for further use in the codebase. Let me say kudos! A software delivery pipeline can be implemented in a variety of ways. For various parts of source tracking, building, testing, gathering metrics, managing versions, and so on, a significant number and type of programs can be utilized in a pipeline.  However, the general procedure is the same. The overall pipeline is handled by a single working application, and each of the processes runs as a specific job or is stage-managed by that application. Individual “jobs” are typically established using a syntax and structure that the orchestration program can understand and control as a process.  Manufacturer’s goods from raw ingredients in a quick, automated, and repeatable manner in a factory. On the other hand, a software delivery pipeline creates releases from source code in a quick, automated, and repeatable manner.  And now, “Continuous delivery” is the overarching strategy for accomplishing the delivery process. “Continuous integration” is the process for starting the assembly line. The method of ensuring quality is referred to as “continuous testing,” while making the finished product available to consumers is referred to as “continuous delivery.”  “DevOps” practitioners are the overall efficiency gurus who ensure that everything runs smoothly and efficiently for everyone. CI/CD pipelines are there around for a long time (Traditional) A four-stage pipeline that is simple to understand.  The developer writes the code and then commits the modifications to a central code repository.  The server is triggered when the report detects a change.  Gets the new code and automates the build and testing process. If any errors are discovered during creating or testing, the development team is automatically notified via predefined means, such as email or Slack.  AWS Elastic Beanstalk, an application orchestration service, is used to upload the final package. CI/CD workflow in the cloud  The trend is to migrate DevOps tasks to the cloud as cloud technologies become more widely adopted. Azure and AWS, for example, offer a whole suite of services for managing all of the needed DevOps tasks on their respective platforms.  CI/CD pipelines reduce manual labor and efficiency for software dev Let me give you some final thoughts about CI and CD where a properly constructed pipeline will boost delivery team efficiency by lowering manual labor and eliminating the majority of manual errors while improving overall product quality.  In addition, end-users, developers, and the business will benefit from a speedier and more agile development life cycle as a result of this. Right now, CI and CD are learning from Human’s decision to use a modern mainframe development environment in order to edit and debug code which is mainly to increase the speed and quality of the work.  Automation is to make things easier and so to make software development the easiest.

Read more
Contact us

Partner with Nyx Wolves

As an experienced provider of AI and IoT software solutions, Nyx Wolves is committed to driving your digital transformation journey. 

Your benefits:

What happens next?
1

We Schedule a call at your convenience 

2

We do a discovery and consulting meting 

3

We prepare a proposal 

Schedule a Free Consultation