How to use the GitLab CI YAML Generator
- 1. Pick the project typeNode.js, Python, Java (Maven) or Go.
- 2. Choose jobsLint, tests, build artifacts, Docker image and a deploy job.
- 3. GenerateCommit the file to your repository root and push.
How the pipeline is built
Jobs run in stages: test (lint and unit tests in parallel), build (your app's build output kept as an artifact, and a Docker image pushed to GitLab's own container registry), and deploy. Dependencies are cached using your lockfile as the cache key, so they're downloaded again only when the lockfile changes. Test results are published as JUnit reports for Python, Java and Go, so failures appear in merge requests. The Docker and deploy jobs run only on the default branch, and the deploy job uses a resource group so two deploys never overlap. Built-in GitLab variables such as $CI_REGISTRY_IMAGE mean no passwords go in the file.
We generated 60 job combinations across the four stacks and checked each with gitlab-ci-local, which validates the file against GitLab's schema and lists the jobs.
Worked example
For Node.js with every option on and a manual deploy, the file has 5 jobs in 3 stages: lint and unit-tests on node:22-alpine, build (keeping dist/ for a week), docker-image (built with Docker-in-Docker and tagged with the commit), and deploy, which waits for someone to press play on the default branch.
Tips
- Paste the file into Build → Pipeline editor in GitLab to validate it before committing.
- Store deploy keys and tokens as masked CI/CD variables in the project settings.
- Docker-in-Docker needs privileged runners; GitLab.com's shared runners support it.
Frequently asked questions
Will this work on GitHub Actions?
No; GitHub uses a different format. The ideas (stages, cache, artifacts) carry over.
Why do merge requests get their own pipeline?
The workflow rules run one pipeline per merge request instead of two (branch and MR), saving runner minutes.
Is the GitLab CI generator free?
Yes. You can open the GitLab CI generator and change every input and rate without signing up. When you generate the file for the first time, we ask once for your name and WhatsApp number; after that it, and every other Uncodemy tool, opens straight away.