Using GitLab and GitHub to build your CI/CD pipeline

NicolasBrondinBernard

Author
@NicolasBrondinBernard

Wanting to do CI/CD is great! But actually managing to set it up is better!

Article published on 03/06/2022, last updated on 10/08/2026

This is a guest post, written by Riccardo Pons and Sandra Salerno, from the startup R2Devops!

In a previous article, we explained what CI/CD is, and why integrating a pipeline will improve your development project.

It's time to talk to you about two widely used platforms for building your CI/CD: GitLab and GitHub!

GitLab and jobs

GitLab offers a fairly comprehensive CI/CD platform.

You can build your CI/CD pipeline directly in the interface, and this, for each project hosted there. Let's take a closer look at how GitLab CI/CD works.

Defining your pipeline's stages

First step to building your pipeline on GitLab: you need to define the stages. A stage corresponds to a step in your pipeline. A classic pipeline can look like this:

  • Build: construction and packaging of your software
  • Tests: running static and dynamic tests on your code
  • Provision: preparing your software's infrastructure
  • Review: deploying your solution in an isolated environment
  • Release: going live and creating version tags
  • Deploy: deploying your software in its final environment

GitLab imposes no rules on how you create your stages.

You can do it however you like! These steps only serve to frame the elements that will be applied in your project's CI/CD.

Implementing jobs to define the tasks that will be performed

Now that you've built the structure of your CI/CD pipeline, it's time to move on to the second step: adding jobs!

You can code them yourself, or use jobs from open source libraries to make things easier.

GitLab also offers a feature called Auto DevOps which will analyze your project and help you build its pipeline, by picking from its library of templates the one that best matches your needs!

GitHub and actions

GitHub is a widely used platform for development projects.

The end goal remains the same as with GitLab: building your project's CI/CD pipeline. However, the method to get there is different.

Composing your workflow on GitHub with actions

Let's start with the vocabulary differences.

On GitHub, unlike GitLab, there's no need to define stages for your pipeline! You will create jobs, within which several actions will be found.

The whole is called a workflow.

By default, all the jobs in your workflow will run in parallel, which greatly reduces execution time. Of course, you can also create precedence links between your jobs using the needs keyword. This keyword allows you to define that a job will only start after another one has run successfully.

GitHub has a very comprehensive action library, which will give you access to many features and tools. All you have to do is search for the ones you need to build your jobs and workflows.

Triggering your pipeline whenever you want

Unlike GitLab, where a pipeline is triggered on a commit or a Merge Request, on GitHub it's you who decides when to launch a workflow.

A workflow isn't just for building your CI/CD!

You can indeed build workflows for any type of action, and imagine any type of trigger. For example, you can launch a workflow when a new issue is created on the project, or even when one of your colleagues assigns you a code review.

Of course, you can also trigger a workflow on a commit or a Pull Request (the equivalent of a Merge Request on GitLab).

This is actually what you'll need to implement for your CI/CD pipeline!

Reusing your workflow

Actions are reusable across many jobs and workflows. And the same goes for your workflows: they can be used across different projects.

To work smart, it's best to follow GitHub-specific syntax and make your workflows reusable. This way, you can say "Goodbye" to copy-pasting and code duplication!

Automatically generating your pipeline

Whether you use GitLab or GitHub, creating your first pipelines and workflows will require time and a good dose of knowledge. Fortunately, there are solutions to make things easier for you!

R2Devops offers autopipeline: an artificial intelligence that analyzes your Git project, and builds an efficient and secure CI/CD pipeline. All of this based on open source resources.

Building your CI/CD pipeline can now be done in 1 click!

‌‌


Finished reading this article?
Our newsletter

No spam. Only free content, news, and ever more resources to level up your skills!

Join +1500 developers

Comments (0)

to leave a comment

No comments yet