Continuous integration and continuous deployment (CI/CD) is a practice that enables you to release new versions of your product quickly and frequently. Include SimpleLocalize CLI in your CI/CD pipeline to automate the process of uploading and downloading translations, ensuring that your translation files are always up-to-date with the latest changes in your codebase.
Workflow automation
SimpleLocalize can be integrated with any CI/CD service, such as GitHub Actions, GitLab CI/CD, CircleCI, Travis CI, or AWS CodeBuild.
$ curl -s https://get.simplelocalize.io/2.8/install | bash
$ simplelocalize [command] --apiKey YOUR_API_KEY
GitHub Actions
SimpleLocalize GitHub Action is the easiest way to integrate SimpleLocalize with your GitHub repository. It's a ready-to-use GitHub Action that can be configured in a few minutes. The only thing you need to do is to create a new workflow file in your repository.
Sample .github/workflows/deploy.js
workflow file:
name: 'My project'
on:
push:
branches: [ main ]
env:
cli-version: '2.8.0'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Upload translations
uses: simplelocalize/github-action-cli@v4
with:
api-key: ${{ secrets.SIMPLELOCALIZE_API_KEY }}
command: 'upload'
cli-version: ${{ env.cli-version }}
args: '--uploadPath ./translations/{lang}.json --uploadFormat single-language-json'
- name: Auto-translate project
uses: simplelocalize/github-action-cli@v4
with:
api-key: ${{ secrets.SIMPLELOCALIZE_API_KEY }}
command: 'auto-translate'
cli-version: ${{ env.cli-version }}
- name: Download translations
uses: simplelocalize/github-action-cli@v4
with:
api-key: ${{ secrets.SIMPLELOCALIZE_API_KEY }}
command: 'download'
cli-version: ${{ env.cli-version }}
args: '--downloadPath ./translations/{lang}.json --downloadFormat single-language-json'
- name: Publish translations
uses: simplelocalize/github-action-cli@v4
with:
api-key: ${{ secrets.SIMPLELOCALIZE_API_KEY }}
command: 'publish'
cli-version: ${{ env.cli-version }}
args: '--environment _latest'
- name: Pull translations
uses: simplelocalize/github-action-cli@v4
with:
api-key: ${{ secrets.SIMPLELOCALIZE_API_KEY }}
command: 'pull'
cli-version: ${{ env.cli-version }}
args: "--pullPath ./translation-hosting-resources/ --environment _latest --filterRegex '_index.json'"
AWS CodeBuild
Sample 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/2.8/install | bash
- simplelocalize upload