Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Mastering GitHub Actions
Mastering GitHub Actions

Mastering GitHub Actions: Advance your automation skills with the latest techniques for software integration and deployment

eBook
€20.98 €29.99
Paperback
€37.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

Mastering GitHub Actions

An Overview of GitHub and GitHub Actions

Automation is good, so long as you know exactly where to put the machine.

– Eliyahu Goldratt

Welcome to Mastering GitHub Actions! In this book, we aim to guide you through harnessing the full potential of GitHub Actions in a professional team and enterprise environment. Whether you are a seasoned developer, DevOps engineer, or team lead, this book will provide practical knowledge, real-world examples, and advanced techniques to streamline your software development life cycle using GitHub Actions. By the end of this journey, you will have gained valuable insights and hands-on experience in designing, implementing, and optimizing sophisticated CI/CD pipelines and automation workflows for your organization, and will have taken a peek into GitHub Apps.

In this chapter, after a quick introduction to GitHub, the action runners, and the accounts available, we’ll create an account and work through the required repositories. Also...

Technical requirements

In order to follow along with the hands-on material in this chapter, you will need access to a GitHub account. If you have one already, then great; if not, we’ll create one. To do that, you will require a valid email address to verify your account during creation.

Exploring the GitHub platform

GitHub is a web-based platform for version control and collaboration, enabling developers to collaborate on projects from anywhere in the world. Built on top of the Git distributed version control system, GitHub provides a user-friendly interface for managing and sharing code and tools for issue tracking, code review, and project management. With millions of users and repositories, GitHub has become the largest and most popular open source development and collaboration platform.

The key features of GitHub include the following:

  • Distributed version control with Git
  • Collaborative development with branches, forks, and pull requests
  • Issue tracking and project management tools
  • Integrations with third-party services and APIs
  • Access control and permission management for teams and organizations

Now that you’ve been introduced to the GitHub platform, let’s take a quick walk through the interface and some of the features...

The different types of accounts on GitHub

GitHub offers three types of accounts: personal, organization, and enterprise. Each is different, but enterprise accounts cannot create repositories, unlike organization and personal accounts. Enterprise accounts are accounts that own organizations and can also own user accounts provisioned to their enterprise account via System for Cross-Domain Identity Management (SCIM) processes from their identity provider. A SCIM will automatically synchronize the users within your organization using your SSO platform user store, meaning it will deactivate accounts that have left your business.

Enterprise accounts act as governance accounts that allow you to implement policies over organizations and users directly associated with the enterprise account or indirectly via the organization accounts.

If we put enterprise accounts aside and look at only the organization and personal accounts, we’ll notice more synergies around repository ownership...

Creating a personal GitHub account

The first step in getting started with GitHub is to create a GitHub account, which is relatively easy, straightforward, can be done from a web browser, and is 100% free. To do this, go through the following steps:

  1. Navigate to the Sign Up to GitHub link on the home page or navigate to https://github.com/signup.
  2. Enter your email address in the text field on the page presented. If the value is not valid, it will indicate so on the page.
  3. Enter a strong password. A measurement of the password strength is provided; it’s recommended that you achieve a strong password ranking.
  4. Type in your preferred username; a valid available username will be indicated via validation text beneath the form.
  5. You may wish to be informed of future updates; follow the prompt instructions to opt in or opt out:
Figure 1.2 – Accept the marketing clause

Figure 1.2 – Accept the marketing clause

  1. After selecting this step, you might run into a puzzle...

The different types of plans on GitHub

GitHub offers various plans designed to cater to the needs of different users, from individuals to large enterprises. Understanding the differences between these plans is crucial for selecting the right one for your organization.

What you went through previously was creating a free GitHub account, known as a personal account. There are two other account types available: a Team account and an enterprise account.

Let’s take a closer look at these plans in the following sections. Do note that at the time of writing this, the following were the available offerings; please consult https://github.com/pricing for the latest pricing information.

GitHub Free

The GitHub Free plan is designed for individuals and small teams looking to get started with GitHub. It offers basic features such as unlimited public and private repositories and 2,000 minutes per month of GitHub Actions usage on GitHub-hosted runners. However, this plan does not...

Creating an organization account

This book will use an organization account to build workflows and automated processes. If you’ve been following this book, you should only have a personal account and need to create an organization account. This can be done from a web browser by following these steps:

  1. Navigate to https://github.com/account/organizations/new and ensure you have logged in to GitHub using your personal account beforehand. You’ll get a web page as shown in the following screenshot:
Figure 1.3 – Creation of an organization account

Figure 1.3 – Creation of an organization account

  1. Provide an organization account name and contact email; if either of these is invalid, you’ll get an error message.
  2. Then select the My personal account option under “This organization belongs to”; validate that the account is correct.
  3. Upon completing the robot verification, you can invite others to join your organization on the next screen:
...

A brief introduction to GitHub Actions

Once upon a time, in the world of software engineering, developers struggled with manual, time-consuming, and error-prone tasks that hindered their productivity and collaboration. The introduction of GitHub Actions, a powerful automation platform, marked the beginning of a new era, transforming how developers and teams work together on projects. Fully integrated within GitHub, it enables developers and organizations to create custom workflows for various aspects of their software development life cycle.

Picture a software development team tirelessly working on their project. Prior to GitHub Actions, they had to manually manage tasks such as code reviews, pull request management, issue tracking, building, testing, and deploying their code. This process consumed valuable time and resources that could have been better spent on innovation and delivering value to their customers.

As GitHub Actions entered the scene, it revolutionized the team...

An overview of organization accounts

As mentioned earlier in this chapter, collaboration is more streamlined in a GitHub organization, and access controls are easier to maintain. Organization accounts offer advanced access control and permission management features that make it easy to control who has access to what resources. For example, you can set base permissions for anyone that enters an organization. You can set defaults for repositories, put limits on what can be used, set up self-hosted runners, and more. We will only review some of these aspects in this section as these remaining features are covered in future chapters or are beyond the scope of this book.

Managing teams

One of the most significant benefits of using a GitHub organization account is the ability to create and manage teams within your organization. Teams provide a logical way for group members to work on specific projects or areas, making it easier to collaborate and manage access to repositories. By assigning...

The .github repository

Every organization’s first repository should be a .github repository. This is a special repository that stores organization-wide configuration files and resources that apply to all repositories in the organization. It is a central location for managing settings, templates, and workflows shared across multiple repositories.

By utilizing a .github repository within your organization, you can streamline the management of shared resources and configurations, ensuring that all repositories follow a consistent set of practices and maintain a unified appearance.

Some of the key elements you can store in a .github repository include the following:

  • Workflow templates: You can create and store reusable GitHub Actions workflow templates in the .github repository. Other repositories within the organization can easily access and use these templates, promoting consistency and best practices across your projects.
  • Issue and pull request templates: By...

Templates and reusable workflow repositories

GitHub’s reusable workflows and templates allow you to create and share standardized configurations and workflows across multiple repositories within an organization. They promote best practices, consistency, and efficiency in your projects by providing pre-defined templates for common tasks and scenarios. Let’s look at each feature in more detail in the following sections.

Reusable workflows

Reusable workflows are a GitHub Actions feature that enables you to create a workflow in one repository and use it as a reference in other repositories. This eliminates the need to duplicate workflow configurations across multiple repositories, making maintaining and updating workflows easier.

To create a reusable workflow, you define a workflow with the necessary steps and configuration in one repository, and then use the uses keyword in other repositories to reference that workflow. When a workflow run is triggered in the referencing...

Summary

In this chapter, you have gained a foundational understanding of GitHub’s personal and organization accounts, learning how to create them and navigate their interfaces. These skills will be incredibly valuable moving forward, as the ability to manage accounts effectively is a fundamental part of using GitHub. The process of creating a team within an organization account and establishing repositories was also covered. This knowledge will enable you to organize your projects better, improve collaboration, and manage code more effectively. Understanding these aspects sets a strong foundation for you to better utilize GitHub’s potential in your future work or projects as well as to follow along with the rest of the book.

In the next chapter, we will learn about workflows, as well as how to create some workflows and structure them in the best possible way.

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Master GitHub events to foster a self-service mindset
  • Elevate your GitHub Actions knowledge to a whole new level through real-world examples
  • Learn how to integrate with popular cloud-based products within your workflows
  • Purchase of the print or Kindle book includes a free PDF eBook

Description

Navigating GitHub Actions often leaves developers grappling with inefficiencies and collaboration bottlenecks. Mastering GitHub Actions offers solutions to these challenges, ensuring smoother software development. With 16 extensive chapters, this book simplifies GitHub Actions, walking you through its vast capabilities, from team and enterprise features to organization defaults, self-hosted runners, and monitoring tools. You’ll learn how to craft reusable workflows, design bespoke templates, publish actions, incorporate external services, and introduce enhanced security measures. Through hands-on examples, you’ll gain best-practice insights for team-based GitHub Actions workflows and discover strategies for maximizing organization accounts. Whether you’re a software engineer or a DevOps guru, by the end of this book, you'll be adept at amplifying productivity and leveraging automation's might to refine your development process.

Who is this book for?

This book is for developers with a foundation in CI/CD, code quality tools, and team communication keen on exploring GitHub Actions. It’s ideal for DevOps engineers, system administrators, software developers, IT specialists, automation aficionados, and university students focused on software integration and deployment. Those familiar with GitHub's ecosystem will find this content insightful.

What you will learn

  • Explore GitHub Actions' features for team and business settings
  • Create reusable workflows, templates, and standardized processes to reduce overhead
  • Get to grips with CI/CD integrations, code quality tools, and communication
  • Understand self-hosted runners for greater control of resources and settings
  • Discover tools to optimize GitHub Actions and manage resources efficiently
  • Work through examples to enhance projects, teamwork, and productivity

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Mar 22, 2024
Length: 490 pages
Edition : 1st
Language : English
ISBN-13 : 9781805128625
Concepts :
Tools :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Mar 22, 2024
Length: 490 pages
Edition : 1st
Language : English
ISBN-13 : 9781805128625
Concepts :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 97.97
Mastering Python Design Patterns
€29.99
GitHub Actions Cookbook
€29.99
Mastering GitHub Actions
€37.99
Total 97.97 Stars icon

Table of Contents

21 Chapters
Part 1:Centralized Workflows to Assist with Governance Chevron down icon Chevron up icon
Chapter 1: An Overview of GitHub and GitHub Actions Chevron down icon Chevron up icon
Chapter 2: Exploring Workflows Chevron down icon Chevron up icon
Chapter 3: Deep Dive into Reusable Workflows and Composite Actions Chevron down icon Chevron up icon
Chapter 4: Workflow Personalization Using GitHub Apps Chevron down icon Chevron up icon
Chapter 5: Utilizing Starter Workflows in Your Team Chevron down icon Chevron up icon
Part 2: Implementing Advanced Patterns within Actions Chevron down icon Chevron up icon
Chapter 6: Using HashiCorp Vault in GitHub Chevron down icon Chevron up icon
Chapter 7: Deploying to Azure Using OpenID Connect Chevron down icon Chevron up icon
Chapter 8: Working with Checks Chevron down icon Chevron up icon
Chapter 9: Annotating Code with Actions Chevron down icon Chevron up icon
Chapter 10: Advancing with Event-Driven Workflows Chevron down icon Chevron up icon
Chapter 11: Setting Up Self-Hosted Runners Chevron down icon Chevron up icon
Part 3: Best Practices, Patterns, Tricks, and Tips Toolkit Chevron down icon Chevron up icon
Chapter 12: The Crawler Pattern Chevron down icon Chevron up icon
Chapter 13: The Configuration Centralization Pattern Chevron down icon Chevron up icon
Chapter 14: Using Remote Workflows to Kickstart Your Products Chevron down icon Chevron up icon
Chapter 15: Housekeeping Tips for Your Organization Chevron down icon Chevron up icon
Chapter 16: Handy Workflows for Managing Your Software Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.5
(6 Ratings)
5 star 66.7%
4 star 16.7%
3 star 16.7%
2 star 0%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




BrettHargreaves May 07, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This is an amazing in-depth look at GitHub Actions, from the absolute basics to more advanced options, you're taken through step-by-step.There are so many ways to use and configure GitHub Actions, but this book helps you understand and implement flows for a range a scenarios - a must have for your collection!
Amazon Verified review Amazon
Tiny Mar 25, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Most of us use GitHub for development in some sense. This book details one of the processes associated with GitHub that can help automate workflows and provide a clear reference to needed tasks. Lots of clear screenshots from the GUI and then code level analysis for what has to happen to make the functions work. Details creating the initial workflow, integrating with tools like Vault and Hashicorp JWT as well as others to obtain the needed success throughout the pipeline. Recommend as a reference if you use GitHub actions, or are merely looking for a way to automate and accelerate your pipelines.
Amazon Verified review Amazon
Mayank Jadhav May 01, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
If you're interested in learning Github Actions and looking for a solid resource, "Mastering Github Actions" by Eric Chapman is the top choice.In this book, Eric has explained Github actions from scratch to the advanced level. The emphasis of the book is on experiential learning using real-world examples, so you will not find any difficulty in understanding the concepts.You will learn the Github Actions terms from scratch like - Workflows, Events, Triggers, Jobs, Steps, Matrix.I was intrigued by few advanced concepts that were -1. Using Hashicorp Vault with Github2. Deploying to Azure Using OpenID Connect3. Setting Up Self-Hosted Runners4. Integrating GitHub Actions with SlackHere are some of the things you can learn from the book:1. How to use GitHub Actions to automate tasks such as building, testing, and deploying your code2. How to create reusable workflows that can be used by multiple projects3. How to integrate GitHub Actions with other tools and services4. How to use self-hosted runners to give you more control over your workflows5. How to monitor your workflows to ensure that they are running smoothlyOverall, "Mastering GitHub Actions" is a valuable resource for developers and DevOps professionals who want to harness the power of GitHub Actions to automate their workflows and enhance development efficiency. The book's practical approach and in-depth coverage make it a solid choice for anyone looking to take their GitHub Actions skills to the next level.
Amazon Verified review Amazon
M. Cotic Apr 25, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Just got just got through all of the books details. It was very interesting on how in-depth he explained things to make them so simple. I was pleasantly surprised with this purchase. Looking forward to any future work from the author.
Amazon Verified review Amazon
syed a. Mar 26, 2024
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
"Mastering GitHub Actions" by Eric Chapman offers an in-depth exploration of GitHub Actions, spanning from basic concepts to advanced techniques, making it ideal for a wide range of expertise levels. It excels in providing practical examples and focusing on automation to streamline the development process. However, beginners might find the extensive coverage overwhelming, and the rapid evolution of GitHub Actions could date some content. The book assumes prior knowledge of GitHub and CI/CD, which might challenge new users. Despite these minor drawbacks, it remains a valuable resource for enhancing CI/CD practices.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.