Workflows vs. Pipelines - Overview

Workflows vs. Pipelines - Overview#

Feature

Workflows

Pipelines

Location

Any .yml file in .github/workflows/

.gitlab-ci.yml in the root directory

Mandatory Keys

  • on: determine when to trigger workflows
  • jobs: a set of jobs
  • jobs.<job_name>.steps: a list of tasks to run

  • <job_name>: defining a job
  • <job_name>.script: list of shell commands

Triggers

  • Uses top-level on key to trigger Workflow
  • Job-level if key to skip jobs

  • Uses workflow.rules key to trigger Pipeline
  • Job-level rules key to trigger jobs

Variables

Defined in env at job or Workflow level

Defined in variables at job or Pipeline level

Environment Variables

Provides “context variables” including vars and secrets defined via Web-UI

Provides predefined variables & custom variables defined via Web-UI