# gt: General Translation CLI tool: Staging in CI
URL: https://generaltranslation.com/en-US/docs/cli/guides/continuous-translation/staging-in-ci.mdx
Docs index: https://generaltranslation.com/llms.txt
Description: How to run gt stage alongside lint and tests and fetch results with gt download.

Start translating at the beginning of CI with [`npx gt stage`](/docs/cli/reference/commands/stage), let translations process while lint and tests run, and fetch completed files before your build with [`npx gt download`](/docs/cli/reference/commands/download).

[`gt stage`](/docs/cli/reference/commands/stage) uploads your source files (including inline [`<T>`](/docs/react/reference/components/t) and [`useGT`](/docs/react/reference/hooks/use-gt) content), enqueues translations, writes staged entries to `gt-lock.json`, and sets [`stageTranslations`](/docs/cli/reference/config#stage) to `true` in `gt.config.json` — no separate [`gt upload`](/docs/cli/reference/commands/upload) step is needed. [`gt download`](/docs/cli/reference/commands/download) then checks those staged versions once, writes every completed translation, and runs postprocessing. It does not wait for unfinished jobs — any file still translating is skipped with a warning and stays staged in `gt-lock.json` for a later [`gt download`](/docs/cli/reference/commands/download) run.

## Workflow examples [#workflows]

Set `GT_API_KEY` and `GT_PROJECT_ID` in your CI secrets first. (See [Shared requirements](/docs/cli/guides/continuous-translation#credentials)).

<Tabs items={['Single job', 'Separate jobs']}>
  <Tab value="Single job">
    ```yaml title=".github/workflows/ci.yml"
    name: CI

    on:
      push:
        branches: [main]

    jobs:
      build:
        runs-on: ubuntu-latest
        env:
          GT_API_KEY: ${{ secrets.GT_API_KEY }}
          GT_PROJECT_ID: ${{ secrets.GT_PROJECT_ID }}
        steps:
          - uses: actions/checkout@v4
          - uses: actions/setup-node@v4
            with:
              node-version: 20
          - run: npm ci
          - run: npx gt stage
          - run: npm run lint && npm test
          - run: npx gt download
          - run: npm run build
    ```
  </Tab>

  <Tab value="Separate jobs">
    Pass `gt.config.json` and `gt-lock.json` from the stage job to the build job:

    ```yaml title=".github/workflows/ci.yml"
    name: CI

    on:
      push:
        branches: [main]

    jobs:
      stage:
        runs-on: ubuntu-latest
        steps:
          - uses: actions/checkout@v4
          - uses: actions/setup-node@v4
            with:
              node-version: 20
          - run: npm ci
          - env:
              GT_API_KEY: ${{ secrets.GT_API_KEY }}
              GT_PROJECT_ID: ${{ secrets.GT_PROJECT_ID }}
            run: npx gt stage
          - uses: actions/upload-artifact@v4
            with:
              name: gt-stage
              path: |
                gt.config.json
                gt-lock.json

      test:
        runs-on: ubuntu-latest
        steps:
          - uses: actions/checkout@v4
          - uses: actions/setup-node@v4
            with:
              node-version: 20
          - run: npm ci
          - run: npm run lint && npm test

      build:
        needs: [stage, test]
        runs-on: ubuntu-latest
        steps:
          - uses: actions/checkout@v4
          - uses: actions/setup-node@v4
            with:
              node-version: 20
          - run: npm ci
          - uses: actions/download-artifact@v4
            with:
              name: gt-stage
          - env:
              GT_API_KEY: ${{ secrets.GT_API_KEY }}
              GT_PROJECT_ID: ${{ secrets.GT_PROJECT_ID }}
            run: npx gt download
          - run: npm run build
    ```
  </Tab>
</Tabs>

You also use [`gt stage`](/docs/cli/reference/commands/stage) and [`gt download`](/docs/cli/reference/commands/download) for review-gated projects and asynchronous formats such as Lottie. (See [Managing translations](/docs/cli/guides/managing-translations#review)).

## Next steps

- /docs/cli/guides/continuous-translation/running-in-cd
- /docs/cli/guides/continuous-translation/using-github-actions
- /docs/cli/guides/continuous-translation/splitting-ci-stages
- /docs/cli/guides/managing-translations

## Sitemap

See the full [sitemap](https://generaltranslation.com/sitemap.md) for all pages.
