Skip to content

UPDATE: Automate development tasks by using GitHub Actions #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion github/github-actions-automate-tasks/1-introduction.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: Introduction
metadata:
title: Introduction
description: An introduction to GitHub Actions and workflows.
ms.date: 05/19/2020
ms.date: 08/28/2022
author: juliakm
ms.author: jukullam
ms.topic: interactive-tutorial
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
GitHub Actions optimize code delivery time from idea to deployment on a community-powered platform.

Suppose you manage a team that is developing a web site that will improve your customers' experience when they contact product support. This project is important to upper management. They want a high-quality site, and they want to publish it soon. You need to make sure your team is producing code that tests, builds, and deploys quickly once a feature is implemented. On top of that, your IT department wants to automate the creation and teardown of the project's infrastructure. You decide to use continuous integration (CI) and continuous delivery (CD) to automate all the build, test, and deployment tasks. You're also going to adopt infrastructure as code (IaC) to automate the IT tasks.
Imagine you manage a team that is developing a web site that will improve your customers' experience when they contact product support. This project is important to upper management. They want a high-quality site, and they want to publish it soon.

You need to make sure your team is producing code that tests, builds, and deploys quickly once a feature is implemented. On top of that, your IT department wants to automate the creation and teardown of the project's infrastructure. You decide to use continuous integration (CI) and continuous delivery (CD) to automate all the build, test, and deployment tasks. You're also going to adopt infrastructure as code (IaC) to automate the IT tasks.

There are several tools available to help you achieve these goals. However, since you're already using GitHub for your code repository, you decide to investigate GitHub Actions to see if it provides the automation you need.

Expand All @@ -12,7 +14,7 @@ In this module, you'll:

- Learn what GitHub Actions are, the types of actions, and where to find them.
- Identify the required components within a GitHub Actions workflow file.
- Plan the automation of your software-development lifecycle with GitHub Actions workflows.
- Understand common configurations to automate your development lifecycle with GitHub Actions workflows.
- Create a container action and have it run in a workflow that's triggered by a push event to your GitHub repository.

## Prerequisites
Expand Down
Original file line number Diff line number Diff line change
@@ -1,39 +1,10 @@
Here, we'll introduce GitHub Actions and workflows. You'll learn the types of actions you can use and where to find them. You'll also look at examples of these types of actions and how they fit in a workflow.

## GitHub decreases time from idea to deployment

GitHub is designed to help teams of developers and DevOps engineers build and deploy applications quickly. There are many features in GitHub that enable this, but they generally fall into one of two categories:

- **Communication:** Consider all of the ways that GitHub makes it easy for a team of developers to communicate about the software development project: code reviews in pull requests, GitHub issues, project boards, wikis, notifications, and so on.
- **Automation:** GitHub Actions lets your team automate workflows at every step in the software-development process, from integration to delivery to deployment. It even lets you automate adding labels to pull requests and checking for stale issues and pull requests.

When combined, these features have allowed thousands of development teams to effectively decrease the amount of time it takes from their initial idea to deployment.

## Use workflow automation to decrease development time

In this module we'll focus on automation, so let's take a moment to understand how teams can use automation to reduce the amount of time it takes to complete a typical development and deployment workflow.

Consider all of the tasks that must happen *after* the code is written, but before the code can be reliably used for its intended purpose. Depending on your organization's goals, you'll likely need to perform one or more of the following tasks:

- Ensure the code passes all unit tests
- Perform code quality and compliance checks to make sure the source code meets the organization's standards
- Check the code and its dependencies for known security issues
- Build the code integrating new source from (potentially) multiple contributors
- Ensure the software passes integration tests
- Version the new build
- Deliver the new binaries to the appropriate filesystem location
- Deploy the new binaries to one or more servers
- If any of these tasks do not pass, report the issue to the proper individual or team for resolution

The challenge is to do these tasks reliably, consistently, and in a sustainable manner. This is an ideal job for workflow automation. If you're already relying on GitHub, you'll likely want to set up your workflow automation using GitHub Actions.

## What is GitHub Actions?
## What are GitHub Actions?

*GitHub Actions* are packaged scripts to automate tasks in a software development workflow in GitHub. You can configure GitHub Actions to trigger complex workflows that meet your organization's needs; each time developers check new source code into a specific branch, at timed intervals, or manually. The result is a reliable and sustainable automated workflow, which leads to a significant decrease in development time.

## Where can you find GitHub Actions?

GitHub Actions are scripts that adhere to a yml data format. Each repository has an **Actions** tab that provides a quick and easy way to get started with setting up your first script. If you see a workflow that you think might be a great starting point, just select the **Configure** button to add the script and begin editing the source yml.
GitHub Actions are scripts that adhere to a yml data format. Each repository has an **Actions** tab that provides a quick and easy way to get started with setting up your first script. If you see a workflow that you think would be a great starting point, just select the **Configure** button to add the script and begin editing the source yml.

:::image type="content" source="../media/github-actions-automate-development-tasks-01.png" alt-text="Screenshot of the *Actions tab* in GitHub Actions displaying a simple workflow and a button to set up this workflow.":::

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ To further reduce the risk of a user using Actions to merge a change into a prot

One of the best things about GitHub Actions is that it gives developers the ability to automate all of their software workflows. Unfortunately, as GitHub Actions has grown, there has been a wide variety of bad actors abusing Actions, affecting service performance, and causing denial of service to open source projects.

To help prevent this, GitHub has made two changes to how they treat pull requests from from public forks in Actions to help maintainers.
To help prevent this, GitHub has made two changes to how they treat pull requests from public forks in Actions to help maintainers.

- First, if GitHub determines an Actions run to be abusive or against our terms, GitHub's enforcement will be directed at the account hosting the fork and not the account associated with the upstream repository. The result of this process is to prevent maintainer accounts from being flagged and blocked due to these bad actors.

Expand Down
7 changes: 4 additions & 3 deletions github/github-actions-automate-tasks/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ title: "Automate development tasks by using GitHub Actions"
summary: Create a basic GitHub Action and use that action in a workflow.
abstract: |
In this module, you will:
- Describe GitHub Actions, the types of actions, and where to find them
- Plan an automation of your software development life cycle with GitHub Actions workflows
- Create a container action and have it run in a workflow triggered by a push event to your GitHub repository
- Learn what GitHub Actions are, the types of actions, and where to find them.
- Identify the required components within a GitHub Actions workflow file.
- Understand common configurations to automate your development lifecycle with GitHub Actions workflows.
- Create a container action and have it run in a workflow that's triggered by a push event to your GitHub repository.
prerequisites: |
- A [GitHub](https://github.com?azure-portal=true) account
- The ability to navigate and edit files in GitHub
Expand Down