Skip to content

GitHub Actions workflow structure

GitHub Actions is a CI/CD pipeline tool used for automation, relying on configuration files stored in a specific directory path to define workflows^[github-action.md].

Core Structure

The fundamental execution flow of a GitHub Actions workflow follows a hierarchy of event -> workflows -> jobs^[github-action.md].

  • Events: Workflows are triggered by specific events, such as a push or pull request^[github-action.md].
  • Workflows: A workflow is the top-level automated process. Multiple workflows can run in parallel^[github-action.md].
  • Jobs: Each workflow consists of one or more jobs. In this context, jobs are sometimes referred to as "actions" within the workflow^[github-action.md].

Configuration

To utilize GitHub Actions, workflow configuration files must be placed in the .github/workflows directory of the repository^[github-action.md].

Execution Environment

Workflows are executed on runners, which are the virtual machines that run the jobs^[github-action.md]. Users can choose between:

  • GitHub-hosted runners: Provided by GitHub, often specified using labels like ubuntu-latest^[github-action.md].
  • Self-hosted runners: Custom environments managed by the user^[github-action.md].

Sources

^[github-action.md]