Workflows Intro
Events: Workflow Triggers¶
Events are actions that trigger workflows, such as code pushes, pull request creations, or scheduled intervals. These events initiate the execution of workflows, determining when specific jobs should run. For example, a push event might trigger a build process, while a pull_request event could initiate testing. Events are defined in the workflow file using keys like on: to specify which actions activate the workflow.
Jobs: Units of Work¶
Jobs are individual units of work within a workflow, consisting of one or more steps that execute in a defined order. Each job is assigned to a runner and is configured using the jobs key in the workflow file. Jobs can include steps like running scripts, building applications, or running tests. A job’s execution environment is specified via the runs-on key, which determines whether it uses a hosted or self-hosted runner. For example:
Runners: Execution Environments¶
Runners are the machines where jobs execute. GitHub provides hosted runners (managed by GitHub) and self-hosted runners (managed by you). Hosted runners are available for public and private repositories, while self-hosted runners are optional for private repositories (though specific configuration is required) but are necessary for custom environments or when security constraints prevent using hosted runners. Runners are specified using the runs-on key in a job, as shown in the example above.