Improve the CI and the translation in readthedocs #825
Workflow file for this run
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: update-translations | |
on: | |
pull_request: | |
schedule: | |
- cron: "0 0 * * *" #runs at 00:00 UTC everyday | |
jobs: | |
ubuntu: | |
runs-on: ubuntu-latest | |
env: | |
SPHINXINTL_TRANSIFEX_ORGANIZATION_NAME: sphinx-doc | |
SPHINXINTL_TRANSIFEX_PROJECT_NAME: sphinx-doc | |
TX_TOKEN: ${{ secrets.TX_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
- name: Initialize and update submodule | |
run: | | |
git submodule init | |
git submodule update | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.9 | |
cache: 'pip' | |
- name: Install graphviz | |
run: sudo apt-get install graphviz | |
- name: Install dependencies | |
run: | | |
pip install -U pip setuptools | |
pip install -r ./requirements.txt | |
- name: Install Transifex CLI | |
working-directory: /usr/local/bin | |
run: | | |
curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash | |
tx --version | |
- name: Update translations | |
run: sh ./locale/update.sh | |
- name: After success | |
run: | | |
git config --global user.email "sphinx-auto-update" | |
git config --global user.name "sphinx-auto-update" | |
git add locale | |
git add sphinx | |
git commit -m "[skip ci] by GHA https://github.com/${{ github.repository }}/actions/runs/${{ github.run_number }}" | |
- name: GitHub Push | |
if: github.event_name != 'pull_request' | |
uses: ad-m/github-push-action@v0.8.0 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref }} |