Reader small image

You're reading from  Mastering GitHub Actions

Product typeBook
Published inMar 2024
PublisherPackt
ISBN-139781805128625
Edition1st Edition
Concepts
Right arrow
Author (1)
Eric Chapman
Eric Chapman
author image
Eric Chapman

Eric Chapman holds the position of Senior Delivery and Engineering Manager at a leading retailer in home improvement and trade in Australia and New Zealand. He primarily oversees integration, encompassing platforms such as API Gateway, EventMesh, authorization systems, developer portals, and extract, transform and load (ETL) platforms. Eric leads a team with a broad range of responsibilities and skills, overseeing all business areas. Previously, Eric and his team were instrumental in designing and developing an in-house point-of-sale system. This singular application accommodated four countries' tax and auditing requirements, supported multiple payment processing gateways, and incorporated a range of unique market-leading features.
Read more about Eric Chapman

Right arrow

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.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Mastering GitHub Actions
Published in: Mar 2024Publisher: PacktISBN-13: 9781805128625
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Eric Chapman

Eric Chapman holds the position of Senior Delivery and Engineering Manager at a leading retailer in home improvement and trade in Australia and New Zealand. He primarily oversees integration, encompassing platforms such as API Gateway, EventMesh, authorization systems, developer portals, and extract, transform and load (ETL) platforms. Eric leads a team with a broad range of responsibilities and skills, overseeing all business areas. Previously, Eric and his team were instrumental in designing and developing an in-house point-of-sale system. This singular application accommodated four countries' tax and auditing requirements, supported multiple payment processing gateways, and incorporated a range of unique market-leading features.
Read more about Eric Chapman