i18n #614
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: i18n | |
on: | |
push: | |
paths: | |
- '.github/workflows/i18n.yaml' | |
workflow_dispatch: {} # Enable manual triggers | |
schedule: | |
- cron: '17 2 * * *' # Run every night at 02:17 (random minute to avoid high loads) | |
permissions: | |
contents: write | |
env: | |
NODE_VERSION: '16' | |
jobs: | |
refresh: | |
name: i18n | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v3 | |
with: | |
ref: develop | |
- name: Setup NodeJS ${{ env.NODE_VERSION }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
cache: 'yarn' | |
# The scripts require some modules that we need to install. | |
- name: Install dependencies | |
run: yarn install --immutable | |
# Gettext is not installed on Ubuntu by default, so we have to do it here | |
- name: Install gettext | |
run: | | |
sudo apt-get update | |
sudo apt-get install gettext | |
- name: Configure git | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
# Update translations | |
- name: Update translations | |
run: | | |
./scripts/i18n.sh | |
git add -A | |
git diff-index --quiet HEAD || git commit -m "chore(i18n): Update translations" | |
- name: Push changes | |
uses: ad-m/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: develop |