Cette page n’est pas encore traduite en français : elle s’affiche en anglais.

GitLab CI Generator — Build a .gitlab-ci.yml Pipeline

Pick your stack and get a working .gitlab-ci.yml: install with caching, lint and test jobs, a build with artifacts, a Docker image pushed to the GitLab registry, or a GitLab Pages deploy — with rules that run pipelines for merge requests and your default branch without duplicates.

Mis à jour le

Deploy

.gitlab-ci.yml

Vos données ne quittent jamais votre ordinateur. Tout le traitement se fait localement dans votre navigateur.

Comment utiliser : GitLab CI Generator

  1. Choose your stack — Node.js, Python, Go, a Docker image or a static site on GitLab Pages — and set the version.
  2. Tick the jobs you want: lint, test, build, coverage; keep merge request rules on to test every MR.
  3. Optionally add a deploy job to a server over SSH or to Pages, with manual approval if you like.
  4. Commit the file as .gitlab-ci.yml in the repository root — the pipeline starts on the next push.

How the pipeline is put together

  • workflow:rules run the pipeline for merge requests and for pushes to the default branch, and skip the duplicate branch pipeline when an MR is open.
  • cache is keyed on the lock file (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum) so dependencies install quickly and the cache refreshes when they change.
  • artifacts pass the build output to later jobs and keep test and coverage reports, which GitLab shows in the merge request.
  • interruptible: true with “auto-cancel redundant pipelines” stops outdated pipelines when you push again.

Secrets

Never put passwords or keys in the YAML. Add them under Settings → CI/CD → Variables (masked and protected) — the deploy job expects SSH_PRIVATE_KEY and SSH_KNOWN_HOSTS there. The Docker job uses GitLab’s built-in CI_REGISTRY variables, so it needs no setup.

Using GitHub instead? Try the GitHub Actions Generator. Related: Dockerfile Generator, YAML Validator.

Aussi recherché comme : gitlab-ci.yml generator, gitlab ci yml example, gitlab pipeline generator, gitlab ci node, gitlab ci docker build, gitlab pages ci, gitlab ci template.

Outils complémentaires : GitLab CI Generator

  • GitHub Actions Workflow Validator — Paste a workflow from .github/workflows and find problems before CI does — invalid triggers, missing runs-on, broken needs, bad expressions, outdated actions and script-injection risks.
  • Générateur Docker Compose — Cochez les services dont vous avez besoin — application, base de données, cache, interface d'administration, gestionnaire de messagerie — et obtenez un fichier compose.yaml épuré comprenant des images épinglées, des volumes nommés, des contrôles d'intégrité et depends_on conditions, ainsi qu’un fichier .env correspondant contenant des mots de passe générés.
  • Kubernetes YAML Generator — Fill in your app’s name, image and port and get production-ready Kubernetes YAML: a Deployment with probes, resource limits and a hardened security context, plus the Service, Ingress with TLS, ConfigMap, Secret and HorizontalPodAutoscaler you tick — in one file ready for kubectl apply.
  • systemd Service Generator — Run your app as a proper Linux service that starts on boot and restarts when it crashes.

Questions fréquentes

Where does .gitlab-ci.yml go?
In the root of the repository. GitLab reads it on every push; you can also check it under Build → Pipeline editor, which validates the syntax.
Why does my pipeline run twice for a merge request?
Without workflow rules GitLab creates a branch pipeline and a merge request pipeline. The generated workflow:rules block keeps only one.
How do I build and push a Docker image in GitLab CI?
Choose the Docker image stack: it logs in with the built-in CI_REGISTRY variables, builds with Docker-in-Docker and pushes a tag for the commit and latest for the default branch.
How do I publish to GitLab Pages?
Choose GitLab Pages: the job builds your site and moves the output into the public folder, which GitLab publishes automatically.
Puis-je installer GitLab CI Generator en tant qu’application web et l’utiliser hors ligne ?
Oui. GitLab CI Generator est une application web installable (PWA) : elle s’installe depuis votre navigateur, sans passer par une boutique d’applications. Cliquez sur « Installer l’application » en haut de cette page dans Chrome ou Edge (Windows, macOS, Linux, ChromeOS) ; sur Android, utilisez « Partager » → « Ajouter à l’écran d’accueil » sur iPhone et iPad ; ou « Fichier » → « Ajouter au Dock » dans Safari 17+ sur Mac. L’application s’ouvre alors dans sa propre fenêtre avec sa propre icône, et comme elle s’exécute entièrement dans votre navigateur, elle continue de fonctionner hors ligne. Firefox sur ordinateur de bureau ne permet pas d’installer d’applications web. Comment fonctionne l’installation.

Outils similaires