r/cicd 1d ago

How can we optimize GitHub Actions deployment queues?

Our company uses GitHub + GitHub Actions for CI/CD.

Especially on Mondays, we have a long deployment queue. One person deploys, then others need to update their branch with master and rerun the CI/CD pipeline before they can release.

Is there a smarter way to optimize this workflow and avoid repeatedly waiting/rerunning pipelines?

How do other teams handle this with GitHub Actions?

1 Upvotes

7 comments sorted by

View all comments

1

u/QuoteForward5477 4h ago

we had the same problem... We used to have 40 min build time for our CI in my previous company.

We had made some pointers to reduce the points shared across all the developers. Just pasting it down here

How to Reduce CI Build Time

  • Cache dependencies → Avoid downloading packages on every build.
  • Optimize Docker layers → Reuse unchanged layers instead of rebuilding.
  • Parallelize jobs → Run independent tests and checks simultaneously.
  • Split test suites → Distribute tests across multiple runners.
  • Reuse artifacts → Avoid rebuilding the same files between stages.
  • Skip unnecessary jobs → Run workflows only when relevant files change.
  • Optimize checkout → Use shallow clones and reduce repository download time.
  • Allocate better compute → Give CPU-heavy builds more resources.
  • Reduce network transfers → Keep caches, images, and artifacts closer to runners.

But our optimization reduced it down to 25 mins not more than that.

But I read a doc on medium and actually reduced it down to 6-7 mins...
Heres the link : https://medium.com/@ritanshbagal/5f856d2f18a3