Boneyard Tools

GitLab CI/CD Generator

Set up a GitLab pipeline without memorising the YAML. Choose your image, stages, jobs, dependency caching and variables, then copy or download a ready-to-commit .gitlab-ci.yml.

How to generate a .gitlab-ci.yml

  1. Set the Docker image and package manager your project uses, like node:20 and npm.
  2. Toggle the jobs you need (install, lint, test, build, deploy) and turn on caching if you want faster runs.
  3. Copy the generated YAML or download it as .gitlab-ci.yml into the root of your repository.

Examples

Lint, test and build with caching

image node:20, jobs: lint+test+build, cacheDeps: true
image: node:20
stages:
  - build
  - test
  - deploy
cache:
  paths:
    - .npm/
    - node_modules/
lint:
  stage: test
  script:
    - npm ci
    - npm run lint
...

Test-only pipeline

image node:20, jobs: test
image: node:20
stages:
  - build
  - test
  - deploy
test:
  stage: test
  script:
    - npm ci
    - npm test

Frequently asked questions

What is a .gitlab-ci.yml file?

It is the configuration GitLab CI/CD reads to run your pipeline. It defines the Docker image, the ordered stages and the jobs (with their scripts) that run on every push or merge request.

Where do I put the generated file?

Save it as a file named exactly .gitlab-ci.yml in the root of your repository. GitLab detects it automatically and runs the pipeline on your next push.

What does the cache option do?

It adds a cache: block keyed on your lockfile that stores the dependency directory (like node_modules and the package manager store) between jobs and runs, so installs are faster on repeat pipelines.

Can I use yarn or pnpm instead of npm?

Yes. Pick your package manager and the install, lint, test and build scripts switch to the matching commands, such as yarn install --frozen-lockfile or pnpm test.

Do the stages have to be build, test and deploy?

No. Those are sensible defaults that match GitLab's conventions, but you can edit the stage list. Each job is mapped to a stage, and GitLab runs the stages in the order you list them.

Is my configuration sent to a server?

No. The YAML is generated entirely in your browser. Nothing you type, including variable names and values, is uploaded or stored.

Related tools