Hands-on GitHub Actions: Implement CI/CD with GitHub Action Workflows for Your Applications
()
About this ebook
Implement continuous integration/continuous delivery (CI/CD) workflows for any application you develop through GitHub Actions. This book will give you an in-depth idea of implementation patterns, solutions for different technology builds, guidelines to implement your own custom components as actions, and usage of features available with GitHub Actions workflows, to set up CI/CD for your repositories.
Hands-on GitHub Actions starts with an introduction to GitHub actions that gives an overview on CI/CD followed by an introduction to its workflows. Next, you will learn how to use variables in a GitHub workflow along with tokens via a REST API. Further, you will explore artifacts and caching dependencies in GitHub and use artifacts in subsequent jobs. Using self-hosted runners is discussed next where you will set up your own hardware and software to run GitHub actions. You will go through publishing packages and migrate to Azure DevOps Pipelines. Along the way, youwill use Redis service and PostgreSQL service containers and create custom actions. Finally, you will work with GitHub apps and understand the syntax reference for GitHub Actions and workflows.
What You Will Learn
- Create workflows for any platform and any language with GitHub Actions
- Develop custom GitHub actions to enhance features and usage of database and service containers Use hosted runners and create self-hosted runners for GitHub workflows
- Use GitHub Package registry with GitHub Actions to share and use packages
Who This Book Is For
DevOps teams who want to build quality CI/CD workflows.Read more from Chaminda Chandrasekara
Hands-on Azure Pipelines: Understanding Continuous Integration and Deployment in Azure DevOps Rating: 0 out of 5 stars0 ratingsHands-on Azure Repos: Understanding Centralized and Distributed Version Control in Azure DevOps Services Rating: 0 out of 5 stars0 ratingsHands-on Azure Boards: Configuring and Customizing Process Workflows in Azure DevOps Services Rating: 0 out of 5 stars0 ratingsHands-On Functional Test Automation: With Visual Studio 2017 and Selenium Rating: 0 out of 5 stars0 ratings
Related to Hands-on GitHub Actions
Related ebooks
DevOps Bootcamp Rating: 0 out of 5 stars0 ratingsAzure DevOps for Web Developers: Streamlined Application Development Using Azure DevOps Features Rating: 0 out of 5 stars0 ratingsPython for Developers Rating: 0 out of 5 stars0 ratingsLearning Elasticsearch 7.x: Index, Analyze, Search and Aggregate Your Data Using Elasticsearch (English Edition) Rating: 0 out of 5 stars0 ratingsAnsible for IT Experts Rating: 0 out of 5 stars0 ratingsGetting Started with Terraform Rating: 5 out of 5 stars5/5Developing with Docker Rating: 5 out of 5 stars5/5Monitoring Docker Rating: 0 out of 5 stars0 ratingsAnsible For Containers and Kubernetes By Examples Rating: 0 out of 5 stars0 ratingsDocker Demystified: Learn How to Develop and Deploy Applications Using Docker (English Edition) Rating: 0 out of 5 stars0 ratingsExtending Docker Rating: 0 out of 5 stars0 ratingsReact and Libraries: Your Complete Guide to the React Ecosystem Rating: 0 out of 5 stars0 ratingsHands-On Parallel Programming with C# 8 and .NET Core 3: Build solid enterprise software using task parallelism and multithreading Rating: 0 out of 5 stars0 ratingsPractical Docker with Python: Build, Release and Distribute your Python App with Docker Rating: 0 out of 5 stars0 ratingsHands-On Microservices with Kubernetes: Build, deploy, and manage scalable microservices on Kubernetes Rating: 5 out of 5 stars5/5Docs Like Code: Collaborate and Automate to Improve Technical Documentation Rating: 5 out of 5 stars5/5Learn Git in a Month of Lunches Rating: 0 out of 5 stars0 ratingsBeginning Git and GitHub: A Comprehensive Guide to Version Control, Project Management, and Teamwork for the New Developer Rating: 0 out of 5 stars0 ratingsPractical Git: Confident Git Through Practice Rating: 0 out of 5 stars0 ratingsAPI Gateway, Cognito and Node.js Lambdas Rating: 5 out of 5 stars5/5Surviving the Whiteboard Interview: A Developer’s Guide to Using Soft Skills to Get Hired Rating: 5 out of 5 stars5/5DevOps in Python: Infrastructure as Python Rating: 0 out of 5 stars0 ratingsLINQ in Action Rating: 0 out of 5 stars0 ratings
Programming For You
Game Development with Unreal Engine 5: Learn the Basics of Game Development in Unreal Engine 5 (English Edition) Rating: 0 out of 5 stars0 ratingsJava for Beginners: A Crash Course to Learn Java Programming in 1 Week Rating: 5 out of 5 stars5/5Python Programming : How to Code Python Fast In Just 24 Hours With 7 Simple Steps Rating: 4 out of 5 stars4/5Excel : The Ultimate Comprehensive Step-By-Step Guide to the Basics of Excel Programming: 1 Rating: 5 out of 5 stars5/5Python: For Beginners A Crash Course Guide To Learn Python in 1 Week Rating: 4 out of 5 stars4/5HTML & CSS: Learn the Fundaments in 7 Days Rating: 4 out of 5 stars4/5Grokking Algorithms: An illustrated guide for programmers and other curious people Rating: 4 out of 5 stars4/5C# Programming from Zero to Proficiency (Beginner): C# from Zero to Proficiency, #2 Rating: 0 out of 5 stars0 ratingsSQL QuickStart Guide: The Simplified Beginner's Guide to Managing, Analyzing, and Manipulating Data With SQL Rating: 4 out of 5 stars4/5Coding All-in-One For Dummies Rating: 4 out of 5 stars4/5Learn JavaScript in 24 Hours Rating: 3 out of 5 stars3/5PYTHON: Practical Python Programming For Beginners & Experts With Hands-on Project Rating: 5 out of 5 stars5/5Python Machine Learning By Example Rating: 4 out of 5 stars4/5Learn to Code. Get a Job. The Ultimate Guide to Learning and Getting Hired as a Developer. Rating: 5 out of 5 stars5/5Python Data Structures and Algorithms Rating: 5 out of 5 stars5/5Problem Solving in C and Python: Programming Exercises and Solutions, Part 1 Rating: 5 out of 5 stars5/5Python QuickStart Guide: The Simplified Beginner's Guide to Python Programming Using Hands-On Projects and Real-World Applications Rating: 0 out of 5 stars0 ratingsLearn SQL in 24 Hours Rating: 5 out of 5 stars5/5Linux: Learn in 24 Hours Rating: 5 out of 5 stars5/5Raspberry Pi Cookbook for Python Programmers Rating: 0 out of 5 stars0 ratings
Reviews for Hands-on GitHub Actions
0 ratings0 reviews
Book preview
Hands-on GitHub Actions - Chaminda Chandrasekara
© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2021
C. Chandrasekara, P. HerathHands-on GitHub Actionshttps://doi.org/10.1007/978-1-4842-6464-5_1
1. Introduction to GitHub Actions
Chaminda Chandrasekara¹ and Pushpa Herath²
(1)
Dedigamuwa, Sri Lanka
(2)
Hanguranketha, Sri Lanka
GitHub is the most widely embraced repository platform for software developers and open source communities. Large enterprises and individual developers use the GitHub platform to keep versioned source code. GitHub can be integrated with Azure Pipelines and other CI/CD (continuous integration and continuous deployment) tools to provide software delivery automation. Instead of using third-party integrations for GitHub repositories, you can now use GitHub Actions as workflows to implement CI/CD pipelines.
This chapter briefly explores CI/CD to help you understand why software delivery automation is vital for software development teams to succeed and be competitive. It also introduces GitHub Actions’ basic concepts to prepare you for the upcoming chapters in the book.
Continuous Integration and Continuous Delivery
In software development, multiple team members develop code and contribute to creating the software’s functionality. When multiple people contribute to a code base, it is important to maintain its integrity and ensure that any team member can retrieve the latest version and build and run it locally.
Two important aspects should be maintained to assure the code base's stability. The first aspect is to ensure that the code is compiling without errors. The second aspect is to ensure that all unit tests validating code behavior pass, including the latest code changes, at a very high percentage.
A build pipeline should be defined to compile each check-in/commit to the code base and then execute all unit tests to validate the code base to ensure its stability; this is generally known as a CI build. If the build successfully compiles and all the unit tests pass, it generates and publishes output that is deployed to a target environment (see Figure 1-1).
../images/502534_1_En_1_Chapter/502534_1_En_1_Fig1_HTML.jpgFigure 1-1
Continuous integration
Checking for code security vulnerabilities can be integrated into the build pipeline to improve a project/product’s security. The quality of the code can be validated in a build pipeline. Early detection of security vulnerabilities and code quality issues with a shift-left approach reduces costs in the long run because a vulnerability detected during production is costly to fix.
Development teams produce software in short cycles in modern, agile software development approaches. One of the biggest challenges is ensuring a software release’s reliability in target environments. A straightforward and reusable deployment process is essential in reducing the cost, time, and risks of delivering software changes, including incremental updates to an application in production. In a nutshell, continuous delivery ensures that software changes are delivered more frequently and reliably. DevOps has evolved as a product of continuous delivery.
Continuous delivery ensures that every change is deployed to production with the option to hold deployment until manual approval is given. Continuous deployment allows every change to be automatically deployed to production. To implement continuous deployment, you must have continuous delivery already in place. Continuous deployment is created by automating the approval steps in continuous delivery (see Figure 1-2).
../images/502534_1_En_1_Chapter/502534_1_En_1_Fig2_HTML.jpgFigure 1-2
Continuous delivery vs. deployment
Importance of Software Delivery Automation
Software delivery automation involves a few processes. Code compilation validation, code stability, quality, and security are covered in continuous integration. Integration and functional test automation verify that business needs are being met in software systems. Release or deployment automation delivers and manages deployment configurations automatically. Using infrastructure as code (IaC) and deploying infrastructure with automated pipelines offers a dynamic provisioning environment to a software team, essentially facilitating the agile process and enhancing the DevOps team’s capabilities.
Without software process automation, deploying software would be a challenging task. An Ops team would need to spend a lot of time manually setting up and deploying new environments. There would be a higher possibility of missed steps during setup, leading to a variety of unexpected issues that cost time and money to resolve. Setting up and deploying environments requires additional investment in human resources (see Figure 1-3 (data from IBM System Science Institute Relative Cost of Fixing Defects research