mirror of
https://github.com/scratchfoundation/scratch-blocks.git
synced 2025-08-28 22:10:31 -04:00
ci: add sync_translations job for CircleCI
This commit is contained in:
parent
d605cdc962
commit
cdf0596589
1 changed files with 38 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue