CLI: CI/CD integration

Last modified: March 28, 2021Author: Jakub Pomykała

Include the CLI into your continuous integration and continuous deployment pipeline. Upload and download translations on every Git push.

🤖 Workflow automation

SimpleLocalize can be integrated with any CI/CD service, simply put bash script somewhere in your scripting environment to find and push translation keys:

$ curl -s https://get.simplelocalize.io/install | bash
$ simplelocalize [command] --apiKey YOUR_API_KEY

The best place to run SimpleLocalize script is after successful build because this will not result with wrong internationalisation keys caused by invalid syntax.

Github Actions

Example build.js workflow file:

name: Deploy

on:
  push:
    branches:
      - master

jobs:
  deploy:

    runs-on: ubuntu-latest
    strategy:
      matrix:
        node-version: [10.x]
    steps:
      - uses: actions/[email protected]
      - name: Use Node.js
        uses: actions/setup-[email protected]
        with:
          node-version: ${{ matrix.node-version }}
      - run: npm install
      - run: npm build
        env:
          CI: ""
      - name: SimpleLocalize
        run: curl -s https://get.simplelocalize.io/install | bash && simplelocalize [command]

AWS CodeBuild

Example buildspec.yml

version: 0.1
phases:
  pre_build:
    commands:
      - yarn install
  build:
    commands:
      - yarn run test
      - yarn run build
      # Run SimpleLocalize
      - curl -s https://get.simplelocalize.io/install | bash && simplelocalize [command]

Would you like to help us and share your CI/CD configuration? Write us: [email protected]