name: 🌎 Translations

on:
  push:
    branches:
      - master

jobs:
  translations:
    runs-on: ubuntu-20.04
    if: ${{ github.repository == 'opengisch/QField' }}
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Install Requirements
        run: |
          sudo apt update && sudo apt install qttools5-dev-tools qt5-default
          sudo pip install wheel
          sudo pip install pygithub transifex-client
          ./scripts/ci/env_gh.sh

      - name: "🌍 Push Translations"
        env:
          TX_TOKEN: ${{ secrets.TX_TOKEN }}
        run: ./scripts/ci/update-translations.sh
