Deploy Lokalise integrations to Vercel, Netlify, and Cloud Run platforms.
Use when deploying apps with Lokalise translations to production,
configuring platform-specific secrets, or setting up deployment pipelines.
Trigger with phrases like "deploy lokalise", "lokalise Vercel",
"lokalise production deploy", "lokalise Netlify", "lokalise Cloud Run".
Instrucciones de origen · Vista previa de solo lectura
name
lokalise-deploy-integration
description
Deploy Lokalise integrations to Vercel, Netlify, and Cloud Run platforms.
Use when deploying apps with Lokalise translations to production,
configuring platform-specific secrets, or setting up deployment pipelines.
Trigger with phrases like "deploy lokalise", "lokalise Vercel",
"lokalise production deploy", "lokalise Netlify", "lokalise Cloud Run".
Translations must be downloaded fresh during CI/CD builds to ensure production always ships the latest reviewed content. This skill covers downloading translations as a build step, GitHub Actions workflows for translation sync, Vercel and Netlify build plugin integration, OTA (over-the-air) updates for mobile apps via Lokalise's iOS and Android SDKs, and environment-specific translation bundles.
Prerequisites
Lokalise API token with download permissions (read-only token recommended for CI)
LOKALISE_API_TOKEN and LOKALISE_PROJECT_ID stored as CI secrets
curl and unzip available in CI environment (standard on GitHub Actions runners)
For OTA: Lokalise OTA SDK token (separate from API token, generated in Lokalise dashboard)
Instructions
1. Download Translations in the Build Step
Add a pre-build script that pulls translations from Lokalise before your framework compiles:
Full workflow that downloads translations, builds, and deploys:
# .github/workflows/deploy.ymlname:Build&Deployon:push:branches: [main]
# Trigger from Lokalise webhook (via repository_dispatch)repository_dispatch:types: [translations_updated]
jobs:build-and-deploy:runs-on:ubuntu-lateststeps:-uses:actions/checkout@v4-uses:actions/setup-node@v4with:node-version:20cache:npm-name:Installdependenciesrun:npmci-name:DownloadtranslationsfromLokaliseenv:LOKALISE_API_TOKEN:${{secrets.LOKALISE_API_TOKEN}}LOKALISE_PROJECT_ID:${{secrets.LOKALISE_PROJECT_ID}}run:|
chmod +x ./scripts/download-translations.sh
./scripts/download-translations.sh ./src/locales
-name:Verifytranslationintegrityrun:|
# Ensure all expected languages are present
EXPECTED_LANGS="en fr de ja es"
for lang in $EXPECTED_LANGS; do
if [ ! -f "./src/locales/${lang}.json" ]; then
echo "ERROR: Missing translation file for ${lang}"
exit 1
fi
# Validate JSON
jq empty "./src/locales/${lang}.json" || {
echo "ERROR: Invalid JSON in ${lang}.json"
exit 1
}
done
echo "All translation files present and valid"
-name:Buildrun:npmrunbuild-name:DeploytoVerceluses:amondnet/vercel-action@v25with:vercel-token:${{secrets.VERCEL_TOKEN}}vercel-org-id:${{secrets.VERCEL_ORG_ID}}vercel-project-id:${{secrets.VERCEL_PROJECT_ID}}vercel-args:--prod
To trigger builds when translations change, set up a Lokalise webhook that fires a GitHub repository_dispatch:
# In your webhook handler (see lokalise-webhooks-events)
curl -X POST \
"https://api.github.com/repos/OWNER/REPO/dispatches" \
-H "Authorization: token ${GITHUB_TOKEN}" \
-H "Content-Type: application/json" \
-d '{"event_type": "translations_updated"}'
3. Vercel Build Integration
For Vercel, translations download during the build phase. Configure the token as an environment variable:
# Set Lokalise secrets in Vercel
vercel env add LOKALISE_API_TOKEN production preview
vercel env add LOKALISE_PROJECT_ID production preview
In vercel.json, ensure the build command runs the translation download:
{"buildCommand":"./scripts/download-translations.sh ./src/locales && next build","outputDirectory":".next"}
For ISR/SSR apps that need translations at runtime (not just build time), cache translations in a KV store or download on cold start:
Both SDKs fall back to the bundled translations if OTA download fails, so the app always has working strings.
6. Environment-Specific Translation Bundles
Use tags in Lokalise to manage environment-specific content:
# Download only production-tagged translations
./scripts/download-translations.sh ./src/locales # uses "production" tag filter# For staging: modify the script or use an env var
LOKALISE_TAGS="staging,beta" ./scripts/download-translations.sh ./src/locales
Update download-translations.sh to support dynamic tags:
# Add near the top of download-translations.sh
TAGS="${LOKALISE_TAGS:-production}"
TAG_JSON=$(echo"$TAGS" | jq -R 'split(",")' )
# Use in the curl payload:# "include_tags": $TAG_JSON
This lets you maintain separate translation sets:
production — fully reviewed, stable translations
staging — includes new translations under review
beta — experimental copy for A/B testing
Output
CI/CD pipeline downloading fresh translations before every build
GitHub Actions workflow with translation validation and deployment
Vercel/Netlify configured with Lokalise secrets and build commands
Mobile apps receiving OTA translation updates without app store releases
Environment-specific bundles controlled by Lokalise tags
For handling errors during API calls in your pipeline, see lokalise-common-errors. For managing translation data formats and encoding, see lokalise-data-handling.