Skip to content

GitHub Actions workflow syntax

GitHub Actions is a CI/CD pipeline tool used for automation within GitHub repositories.^[400-devops-04-ci-cd-pipelines-github-github-action.md] Workflows are defined using YAML files stored in the .github/workflows directory of the repository^[400-devops-04-ci-cd-pipelines-github-github-action.md].

Core Concepts

The execution sequence follows a hierarchy: event \(\rightarrow\) workflows \(\rightarrow\) jobs^[400-devops-04-ci-cd-pipelines-github-github-action.md].

  • Workflows: A workflow represents a complete process, which can be configured to run in parallel^[400-devops-04-ci-cd-pipelines-github-github-action.md].
  • Jobs: Each workflow contains one or more jobs (sometimes referred to as actions) that execute specific steps on a runner^[400-devops-04-ci-cd-pipelines-github-github-action.md].
  • Runners: Jobs run on virtual machines, which can be either GitHub-hosted runners or self-hosted runners^[400-devops-04-ci-cd-pipelines-github-github-action.md]. The target environment is specified using the runs-on key (e.g., ubuntu-latest)^[400-devops-04-ci-cd-pipelines-github-github-action.md].

Sources

^[400-devops-04-ci-cd-pipelines-github-github-action.md]