What is a Github workflow?

Hi, in this post we are going to know what is a Github workflow and how can be useful for our projects.

The GitHub Actions platform include:

  • Workflows
  • Events
  • Jobs
  • Runners
  • Actions

What is a workflow?

A workflow is a configurable automated process that will run one or more jobs. 

Workflows are defined by a YAML file checked in to your repository

This is how a Workflow looks like (YAML file):

The workflow will run triggered by an event in your repository, or they can be triggered manually, or at a defined schedule.

Where can I define the workflows?

.github/workflows directory in a repository, a repository can have multiple workflow

Examples of workflows:

  • one workflow to build and test pull requests (file)
  • another workflow to deploy your application every time a release is created (file)
  • another workflow that adds a label every time someone opens a new issue. (file)
  • another workflow (file)…
  • another workflow (file)…

What is an event in a workflow?

An event is a specific activity in a repository that triggers a workflow run. For example, activity can originate from GitHub when someone creates a pull request, opens an issue, or pushes a commit to a repository.

So, in this means that every-time that we push something to master branch then the workflow will be executed.

What is a Job in a workflow?

A job is a set of steps in a workflow that is executed on the same runner. by default, jobs have no dependencies and run in parallel with each other.

What is an action in a workflow?

An action is a custom application for the GitHub Actions platform that performs a complex but frequently repeated task

What is a runner in a workflow?

A runner is a server that runs your workflows when they’re triggered. Each runner can run a single job at a time. GitHub provides Ubuntu Linux, Microsoft Windows, and macOS runners to run your workflows; each workflow run executes in a fresh, newly-provisioned virtual machine.

By Cristina Rojas.