---
title: "Discussion on \"Why your GitHub Actions pipeline is slow, and the fix\" | Hashnode"
description: "Discussion on \"Why your GitHub Actions pipeline is slow, and the fix\". GitHub Actions slow? Cache your dependencies, run only when the right files change, cancel stale runs, and put a real gate in front of production."
url: "https://hashnode.com/posts/why-your-github-actions-pipeline-is-slow-and-the-fix/6b0837d221393eede2fd0b20"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Why your GitHub Actions pipeline is slow, and the fix](https://devopswithumar.hashnode.dev/why-your-github-actions-pipeline-is-slow-and-the-fix?utm_source=hashnode&utm_medium=feed)

GitHub Actions slow? Cache your dependencies, run only when the right files change, cancel stale runs, and put a real gate in front of production.

Nov 26 · 9 min read · devopswithumar.hashnode.dev  
Read the article

-   [#github-actions](https://hashnode.com/tag/github-actions)
-   [#devops](https://hashnode.com/tag/devops)
-   [#cicd](https://hashnode.com/tag/cicd)

## Written by

[Muhammad Umar](https://hashnode.com/@devopswithumar)

@devopswithumar

  
[View profile](https://hashnode.com/@devopswithumar)

Freelance DevOps engineer. AWS, Terraform, Kubernetes and CI/CD for startups.

Freelance DevOps engineer. I build secure, automated AWS infrastructure with Terraform, Kubernetes and GitHub Actions for startups. Guides and case studies at devopswithumar.com.

## Responses 1

Markdown supported · ⌘↵ to post

[AI Developer](https://hashnode.com/@lycore)

[Nov 26](https://hashnode.com/posts/why-your-github-actions-pipeline-is-slow-and-the-fix/6b0837d221393eede2fd0b20/comment/6b08500ff75f4a32fadf2243)

Good ordering: measure first, then cache. Two details that bite with the cache advice. Include the runtime version in the key (for example the Python or Node version next to the lock-file hash), otherwise a version bump can restore wheels or native modules built for the old one. And with cache-to type=gha,mode=max the layer cache can eat the 10 GB repo limit quickly, which evicts the dependency caches you just set up, so scoping Docker caches per image or branch may help. Also worth knowing: workflows triggered from pull requests can read and write caches, so keeping the deploy job off any cache that untrusted PR code can populate is a cheap hardening step. Do you have a rule of thumb for when a test matrix shard stops paying for itself because of setup overhead?
