ci: add sync_translations job for CircleCI

This commit is contained in:
Christopher Willis-Ford 2022-11-02 14:27:32 -07:00
parent d605cdc962
commit cdf0596589

View file

@ -85,6 +85,31 @@ jobs:
- test
- deploy_gh_pages
- deploy_npm
sync_translations:
<<: *defaults
steps:
- run:
name: Sync Translations
command: |
echo "Starting translation sync"
set -ev
git checkout develop
# update translations, and test any updated messages
npm run translate
npm run translate:update
npm run test:messages
# stage any changes in the msg directory
git add ./msg
if git diff --cached --exit-code --quiet; then
echo "Nothing to commit."
else
git commit -m 'Update translations from Transifex [skip ci]'
# add remote, make sure that API token doesn't end up in the log
git remote add origin-translation \
https://${GH_TOKEN}@github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}.git \
> /dev/null 2>&1
git push --set-upstream origin-translation develop
fi
workflows:
version: 2
default:
@ -93,4 +118,16 @@ workflows:
context:
- dockerhub-credentials
- scratch-npm-creds
# TODO: another job to replace i18n/sync_translations.sh
sync_translations:
triggers:
- schedule:
cron: 0 0 * * 1 # weekly on Monday
filters:
branches:
only:
- develop
jobs:
- sync_translations:
context:
- dockerhub-credentials
- scratch-npm-creds