Skip to content
Latchkey

How to Migrate From GitHub Actions to GitLab CI

Actions jobs and needs map to GitLab jobs with stages or needs, uses actions become script steps, and the secrets context becomes CI/CD variables.

Going the other direction, an Actions workflow maps to .gitlab-ci.yml. Jobs become GitLab jobs, needs maps to GitLab needs or stages, uses: actions become script: commands, and secrets.NAME becomes a CI/CD variable.

Concept mapping

GitHub ActionsGitLab CI
jobs: + needs:stages: or needs:
runs-on:tags: (or shared runner default)
uses: actions/setup-nodeimage: + install script
run:script:
secrets.NAMECI/CD variable $NAME
actions/cachecache:

Before

.github/workflows/ci.yml
on: [push]
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: '20'
      - run: npm ci && npm test

After

.gitlab-ci.yml
test:
  image: node:20
  script:
    - npm ci
    - npm test

What does not map cleanly

  • GitLab has no marketplace, so every action becomes an explicit tool install or image choice.
  • Reusable workflows map to include: and extends:, which behave differently from workflow_call.
  • Environments and approvals exist in GitLab too but are configured through different keywords.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →