Back to blog

CI/CD Pipeline Architecture Diagrams: GitHub Actions, GitLab CI & Jenkins Explained (2026)

How to diagram a CI/CD pipeline architecture — source triggers, build/test stages, artifact registries, deployment strategies, OIDC secrets, and how GitHub Actions, GitLab CI, and Jenkins differ.

R
Ryan·Senior AI Engineer
·

A CI/CD pipeline architecture diagram shows how code moves from a developer's commit to a running service in production — every trigger, build step, test gate, artifact store, and deployment target along the way. It is the map that turns an abstract promise ("we ship continuously") into something a new engineer, an auditor, or an incident responder can actually follow.

Teams reach for a pipeline diagram in a handful of recurring moments: onboarding an engineer who needs to understand why a merge to main takes fourteen minutes to reach staging, preparing for a SOC 2 or ISO 27001 audit that asks exactly who can approve a production deploy, running a postmortem after a bad release shipped past a broken test gate, or planning a migration from one CI vendor to another. In all four cases, the diagram has to show not just the happy path but the trust boundaries — where secrets live, where a human has to click approve, and where a rollback would actually kick in.

The core components of a CI/CD pipeline architecture

Source trigger and webhook

Every pipeline starts with a trigger: a push to a branch, a pull request opened or updated, a tag matching a release pattern, a merge to main, or a scheduled cron event. The source control platform (GitHub, GitLab, or a Git server polled by Jenkins) sends a webhook to the CI system, which evaluates trigger rules — branch filters, path filters, commit message flags — to decide whether and which pipeline to run. In your diagram, show the webhook as the entry point and annotate exactly which events fire which pipeline; this is the detail that's hardest to reconstruct from memory during an incident review.

Build stage

The build stage compiles code, resolves dependencies, and produces a deployable unit — usually a container image, but also a compiled binary, a static bundle, or a language-specific package. Modern build stages run inside containerized, ephemeral runners (a fresh container or VM per job) so builds are reproducible and can't leak state between runs. Dependency and layer caching (Docker layer caching, package manager caches keyed by lockfile hash) is the single biggest lever for build speed and should be shown as a dedicated cache store the runner reads from and writes to.

Test stage

The test stage typically runs three tiers: fast unit tests on every commit, slower integration tests against real or containerized dependencies (databases, message queues), and end-to-end (e2e) tests against a deployed preview or staging environment. Because e2e suites are slow, most pipelines parallelize test execution across multiple runners — sharding the suite by file or historical duration — and only proceed past the gate if every shard passes. Your diagram should show the fan-out to parallel test jobs and the fan-in point where results are aggregated before the pipeline is allowed to continue.

Artifact registry

Once a build passes its tests, the output is pushed to an artifact registry: a container registry (Docker Hub, Amazon ECR, Google Artifact Registry, GitHub Container Registry, GitLab Container Registry) for images, or a package registry (npm, PyPI, Maven, a private GitLab/GitHub package feed) for libraries. The artifact is tagged with an immutable identifier — a commit SHA or semantic version — and this is the single artifact that every downstream environment deploys, never a rebuild. Show the registry as a distinct node between build and deploy, with the tagging scheme annotated.

Deployment stage

The deployment stage takes the tagged artifact and releases it using one of a few standard strategies: rolling deployment (replace instances gradually), blue-green (stand up a full parallel environment and cut traffic over atomically, keeping the old version as an instant rollback target), or canary (route a small percentage of live traffic to the new version, watch error rates and latency, then progressively increase). Your diagram should name the strategy explicitly and show the traffic-shifting mechanism — a load balancer weight change, a service mesh routing rule, or a Kubernetes rollout controller.

Environment promotion

Most pipelines promote the same artifact through a chain of environments: dev → staging → production, sometimes with a QA or pre-prod tier in between. Each environment boundary is a trust boundary — different credentials, different approval requirements, sometimes different infrastructure accounts entirely. Diagram each environment as its own bounded region and draw the promotion path between them as a single directional flow, not a web of ad hoc deploy jobs.

Secrets management

Pipelines need credentials to push images, deploy infrastructure, and call cloud APIs. The modern best practice is OIDC federation: instead of storing long-lived cloud credentials as CI secrets, the CI provider issues a short-lived OIDC token scoped to the specific workflow, repository, and branch, and the cloud provider's IAM trusts that token to grant a temporary session. GitHub Actions OIDC (assuming an AWS IAM role or a GCP Workload Identity Federation pool) and GitLab CI OIDC (via ID tokens) both replace static access keys with tokens that expire in minutes and can't be exfiltrated for later reuse. In your diagram, show the OIDC trust relationship explicitly — which repo/branch is trusted, which cloud role it can assume — since this is exactly what a security review will ask for.

Approval gates and manual intervention

Regulated or high-risk deployments include approval gates: a human must explicitly approve before the pipeline proceeds, usually gating the promotion into staging or production. GitHub Actions implements this with environment protection rules and required reviewers, GitLab CI with manual jobs, and Jenkins with the input pipeline step. Diagram every approval gate as a distinct node — not a dotted line — and label who is authorized to approve it, since this is one of the first things auditors and incident reviewers ask to see.

Common CI/CD architecture patterns

Pattern 1: Trunk-based development with feature flags

Every commit merges directly to main, runs the full pipeline, and deploys to production behind a feature flag that keeps the new code path dark until it's explicitly enabled. This avoids long-lived feature branches and the integration pain they cause. The diagram should show the feature flag service as a separate component that the running application queries at request time, independent of the deploy pipeline itself.

Pattern 2: GitOps pull-based deployment (ArgoCD / Flux)

Instead of the CI pipeline pushing credentials out to a cluster, the pipeline's only job is to build the artifact and update a manifest in a Git repository (the desired-state repo). A cluster-side controller — ArgoCD or Flux — continuously reconciles the live cluster state against that Git repo and pulls changes in. No deploy credentials ever leave the cluster. Diagram this as two separate loops: the CI pipeline writing to the manifest repo, and the GitOps controller reading from it and reconciling — with no direct arrow from CI to the production cluster.

Pattern 3: Monorepo with path-based triggers

A single repository holds many services. Instead of running every pipeline on every commit, path filters (GitHub Actions paths:, GitLab CI rules: changes:) trigger only the pipelines for services whose files actually changed. Show this as a router stage after the trigger that fans out to only the affected service pipelines, each with its own build/test/deploy sequence.

Pattern 4: Matrix builds for multi-platform artifacts

A single pipeline definition runs the same build/test steps across a matrix of dimensions — operating system, architecture (amd64/arm64), language version — producing multiple artifacts from one trigger. Both GitHub Actions (strategy.matrix) and GitLab CI (parallel matrix jobs) support this natively. Diagram the matrix as a fan-out from a single build definition into N parallel jobs, converging at a multi-arch image manifest or a combined release artifact set.

How GitHub Actions, GitLab CI, and Jenkins architectures differ

All three tools implement the same conceptual pipeline, but the underlying execution model — and therefore what belongs in your diagram — differs meaningfully.

AspectGitHub ActionsGitLab CIJenkins
Pipeline definitionYAML workflows in .github/workflows/Single .gitlab-ci.yml with stagesGroovy Jenkinsfile (declarative or scripted)
Execution modelHosted or self-hosted runners, ephemeral per jobGitLab Runner with Docker, Kubernetes, or shell executorsController/agent model — long-lived agent nodes
Reuse mechanismReusable workflows and composite actionsinclude: and CI/CD component catalogShared libraries
ExtensibilityMarketplace of community and vendor actionsBuilt-in templates and integrated DevSecOps featuresLarge plugin ecosystem (SCM, notification, deploy targets)
HostingSaaS (GitHub-hosted) or self-hosted runnersSaaS (GitLab.com) or self-managed instanceSelf-hosted only
Diagram emphasisWorkflow → job → step hierarchy, runner labelsStage → job hierarchy, runner executor typeController node, agent pool, plugin integration points

Prompt templates for CI/CD pipeline diagrams

Basic GitHub Actions pipeline to AWS ECS

"A push to the main branch triggers a GitHub Actions workflow. The build job runs on a GitHub-hosted runner, builds a Docker image, and authenticates to AWS using GitHub Actions OIDC assuming an IAM role scoped to this repo and branch — no static AWS keys stored as secrets. The image is tagged with the commit SHA and pushed to Amazon ECR. A test job runs unit and integration tests in parallel with the build. Once both jobs pass, a deploy job updates the ECS service task definition to the new image tag and triggers a rolling deployment across the ECS Fargate service in the staging cluster. Promotion to the production ECS cluster requires a manual approval from a required reviewer using a GitHub Actions environment protection rule."

GitLab CI pipeline with OIDC to GCP

"A merge request pipeline in GitLab CI runs three stages: build, test, deploy. The build stage runs on a Kubernetes-executor GitLab Runner and produces a container image pushed to the GitLab Container Registry, tagged with the commit SHA. The test stage runs unit tests and a containerized integration test suite in parallel jobs. The deploy stage uses GitLab CI's OIDC ID token to authenticate to Google Cloud via Workload Identity Federation, assuming a service account scoped to the staging GCP project with permission only to deploy to Cloud Run. No long-lived GCP service account keys are stored in GitLab CI/CD variables. Deployment to the production GCP project is a manual job requiring approval from the platform team."

GitOps pull-based deployment with ArgoCD

"A GitHub Actions workflow builds a container image on push to main, runs the test suite, and pushes the image to GitHub Container Registry tagged with the commit SHA. On success, the workflow updates the image tag in a Kubernetes manifest inside a separate GitOps config repository and opens a commit to that repo — it does not touch the cluster directly and holds no cluster credentials. An ArgoCD instance running inside the Kubernetes cluster continuously polls the GitOps config repository, detects the manifest change, and reconciles the cluster state to match — pulling the new image and rolling out the deployment. ArgoCD sends a sync status notification to Slack on every reconciliation."

Jenkins pipeline with approval gates for a regulated environment

"A Jenkins controller runs a declarative Jenkinsfile triggered by a webhook from an on-prem Git server. The build stage runs on a dedicated Linux agent node, compiles the application, and publishes the artifact to an internal Nexus package registry tagged with the build number and commit hash. The test stage runs unit, integration, and static security analysis (SAST) in parallel on separate agent nodes, all of which must pass. Deployment to the staging environment is automatic on success. Deployment to the production environment uses Jenkins' input step to pause the pipeline and require manual approval from two named approvers from the compliance team before proceeding, and the approval decision and approver identity are logged to the audit system."

What a good CI/CD architecture diagram must show

  • Trigger conditions: Exactly which events (push, PR, tag, schedule) fire which pipeline, and any branch or path filters that scope them.
  • Environment boundaries: Dev, staging, and production drawn as distinct regions with their own credentials and infrastructure, not implied by job names alone.
  • Secrets and credential flow: Where OIDC federation or vault-based secrets are used instead of long-lived keys, and which identity each pipeline stage assumes.
  • Rollback path: How a bad deploy gets reverted — instant traffic cutover in blue-green, a Git revert in GitOps, or a manual rollback job — not just the forward deploy path.
  • Approval gates: Every point where a human must click approve, and who is authorized to do so.
  • Artifact provenance: That the same immutably tagged artifact — never a rebuild — flows through every environment from staging to production.

Frequently asked questions about CI/CD pipeline architecture

What is a CI/CD pipeline architecture diagram?

A CI/CD pipeline architecture diagram is an architecture diagram that shows how code moves from a source repository trigger through build, test, artifact storage, and deployment stages into one or more environments. It depicts the CI/CD tool (GitHub Actions, GitLab CI, Jenkins, or another), the runners or agents that execute jobs, the artifact registry, the deployment targets, and the security and approval controls — secrets management, OIDC trust relationships, and manual approval gates — that govern the release. It is the standard reference for onboarding, security audits, incident postmortems, and migration planning.

Should I diagram my CI/CD pipeline as push-based or pull-based?

Diagram it as whichever model your pipeline actually implements, and make the distinction explicit rather than implied. In a push-based pipeline (the traditional CI/CD model), the CI system holds deploy credentials and pushes changes directly to the target environment — draw a direct arrow from the CI job to the infrastructure. In a pull-based GitOps model, the CI pipeline only updates a desired-state manifest in Git, and a cluster-side controller like ArgoCD or Flux pulls and reconciles — draw these as two separate, disconnected flows with no direct arrow from CI to the cluster. The pull-based model is generally considered more secure because deploy credentials never leave the cluster, and that security property is exactly what your diagram should make visible.

How do I diagram secrets management in a CI/CD pipeline?

Show every place a pipeline stage obtains a credential and exactly what kind of credential it is. For cloud deployments, the current best practice is OIDC federation: the CI provider (GitHub Actions or GitLab CI) issues a short-lived, workflow-scoped OIDC token, and the cloud provider's identity system (AWS IAM role trust policy, GCP Workload Identity Federation, Azure federated credentials) exchanges it for a temporary session — draw this as a labeled trust arrow between the CI job and the cloud IAM boundary, noting which repo/branch is trusted and which role it can assume. For any secrets that must still be static (third-party API keys, database passwords), show them coming from a dedicated secrets store (GitHub encrypted secrets, GitLab CI/CD variables, HashiCorp Vault) rather than being hardcoded in the pipeline definition, and avoid drawing a single "secrets" blob that hides which stage actually consumes which credential.

Related guides: GitOps architecture diagrams, DevSecOps architecture diagrams, Docker architecture diagrams, and Kubernetes architecture diagram examples.

Ready to try it yourself?

Start Creating - Free