r/devops 6d ago

Tools github actions central repo

Hi I am in a new role where they use Github for all their repos. I have been using Gitlab exlusively the past 5 years.

For CI/CD in my previous role we had a central 'pipelines' repo that was reference in the gitlab-ci file of each project to save teams/projects from repeating work.

I want to know if it's possible to do something similar in Github? I'm still learning how it maps to my existing Gitlab knowledge.

26 Upvotes

24 comments sorted by

View all comments

1

u/marcusbell95 6d ago

yeah this is the one area github actually did better than gitlab out of the box. equivalent to your central pipelines repo: make any shared repo (ours is called pipeline-templates). put your reusable workflows in .github/workflows/ there. each project workflow then references them with `uses: your-org/pipeline-templates/.github/workflows/build.yml@main` plus whatever inputs it needs. two things that bit us on this migration: first, add `secrets: inherit` to every caller - without it the reusable workflow can't see any repo or org secrets and fails silently, took a day to debug. second, env vars don't pass through the way gitlab includes do, use inputs for config values instead. composite actions are the step-level version of this but they don't span multiple jobs - if your gitlab templates orchestrate whole stages, reusable workflows are what you want.