Merge pull request #390 from wikimediabrasil/388_translations #41
This file contains hidden or 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: Compile translations | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'translations/**' | |
| - 'src/web/templates/**' | |
| jobs: | |
| run-translate: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| strategy: | |
| max-parallel: 4 | |
| matrix: | |
| python-version: [3.11] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Install GNU gettext tools | |
| run: sudo apt-get update && sudo apt-get install -y gettext | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v3 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies and compile translations | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r src/requirements.txt | |
| cd src | |
| python manage.py translate | |
| - name: Configure Git | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Check for changes | |
| run: | | |
| git add . | |
| if git diff --cached --quiet; then | |
| echo "No changes to commit; exiting." | |
| exit 0 | |
| fi | |
| git commit -m "Compile localisation updates" | |
| - name: Push changes | |
| if: success() | |
| uses: ad-m/github-push-action@master | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| branch: ${{ github.ref }} |