|
| 1 | +name: Push translation sources |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + paths: |
| 6 | + - 'doc/**/*.rst' |
| 7 | + - 'doc/conf.py' |
| 8 | + - '.github/workflows/push-translation.yml' |
| 9 | +jobs: |
| 10 | + push-translation-sources: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + |
| 13 | + steps: |
| 14 | + - uses: actions/checkout@v2 |
| 15 | + |
| 16 | + - name: Set branch name from source branch |
| 17 | + run: echo "BRANCH_NAME=${GITHUB_HEAD_REF##*/}" >> $GITHUB_ENV |
| 18 | + |
| 19 | + - name: Start translation service deployment |
| 20 | + uses: bobheadxi/deployments@v0.5.2 |
| 21 | + id: translation |
| 22 | + with: |
| 23 | + step: start |
| 24 | + token: ${{secrets.GITHUB_TOKEN}} |
| 25 | + env: translation-${{env.BRANCH_NAME}} |
| 26 | + ref: ${{github.head_ref}} |
| 27 | + |
| 28 | + - name: Setup Python environment |
| 29 | + uses: actions/setup-python@v2 |
| 30 | + |
| 31 | + - name: Setup Python requirements |
| 32 | + run: | |
| 33 | + python -m pip install --upgrade pip |
| 34 | + pip install -r doc/requirements.txt |
| 35 | +
|
| 36 | + - name: Build pot files |
| 37 | + run: python -m sphinx . doc/locale/en -c doc -b gettext |
| 38 | + |
| 39 | + - name: Push POT files to crowdin |
| 40 | + uses: crowdin/github-action@1.0.21 |
| 41 | + with: |
| 42 | + upload_sources: true |
| 43 | + upload_translations: false |
| 44 | + crowdin_branch_name: ${{env.BRANCH_NAME}} |
| 45 | + config: 'doc/crowdin.yaml' |
| 46 | + env: |
| 47 | + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |
| 48 | + CROWDIN_PERSONAL_TOKEN: ${{secrets.CROWDIN_PERSONAL_TOKEN}} |
| 49 | + |
| 50 | + - name: update deployment status |
| 51 | + uses: bobheadxi/deployments@v0.5.2 |
| 52 | + with: |
| 53 | + step: finish |
| 54 | + token: ${{secrets.GITHUB_TOKEN}} |
| 55 | + status: ${{job.status}} |
| 56 | + deployment_id: ${{steps.translation.outputs.deployment_id}} |
| 57 | + env_url: https://crowdin.com/project/tarantool-cartridge-cli/ru#/${{env.BRANCH_NAME}} |
0 commit comments