Multilingual Docs Upload workflow (Pycord-Development/pycord)
The Multilingual Docs Upload workflow from Pycord-Development/pycord, explained and optimized by Latchkey.
CI health: C - fair
Point runs-on at Latchkey and get run de-duplication, job timeouts, self-healing for flaky steps, and up to 58% lower cost, applied automatically.
What it does
This is the Multilingual Docs Upload workflow from the Pycord-Development/pycord repository, a real project running GitHub Actions. It is shown here with attribution under its MIT license.
Below, Latchkey shows a faster, safer version produced by its optimization engine.
The workflow
name: "Multilingual Docs Upload"
on:
push:
paths:
- "discord/**"
- "docs/**"
branches: [ master ]
workflow_dispatch:
schedule:
- cron: "0 0 * * 1"
permissions: write-all
jobs:
upload:
name: "Upload localization base to Crowdin"
runs-on: ubuntu-latest
if: ${{ contains(github.event.head_commit.message, '!crowdin upload') || github.event_name == 'workflow_dispatch' }}
environment: translations
steps:
- name: "Checkout Repository"
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-tags: true
- name: "Install Python"
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version: "3.14"
cache: "pip"
cache-dependency-path: "requirements/_locale.txt"
- name: "Install Dependencies"
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -r requirements/_locale.txt
pip install .[speed,voice,docs]
- name: "Get locales"
run: |
make html
sphinx-build -b gettext . ./build/locales
working-directory: ./docs
- name: "Build locales"
run:
sphinx-intl update -p ./build/locales ${{ vars.SPHINX_LANGUAGES }}
working-directory: ./docs
- name: "Crowdin"
uses: crowdin/github-action@52aa776766211d83d975df51f3b9c53c2f8ba35f # v2.16.3
with:
upload_sources: true
upload_translations: false
download_translations: false
localization_branch_name: ${{ vars.CROWDIN_LOCALIZATION_BRANCH }}
create_pull_request: false
config: "crowdin.yml"
env:
GITHUB_TOKEN: ${{ secrets.CI_TOKEN }}
CROWDIN_PROJECT_ID: ${{ vars.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_API_TOKEN }}
The same workflow, on Latchkey
Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.
name: "Multilingual Docs Upload" on: push: paths: - "discord/**" - "docs/**" branches: [ master ] workflow_dispatch: schedule: - cron: "0 0 * * 1" permissions: write-all concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: upload: timeout-minutes: 30 name: "Upload localization base to Crowdin" runs-on: latchkey-small if: ${{ contains(github.event.head_commit.message, '!crowdin upload') || github.event_name == 'workflow_dispatch' }} environment: translations steps: - name: "Checkout Repository" uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: fetch-tags: true - name: "Install Python" uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 with: python-version: "3.14" cache: "pip" cache-dependency-path: "requirements/_locale.txt" - name: "Install Dependencies" run: | python -m pip install --upgrade pip setuptools wheel pip install -r requirements/_locale.txt pip install .[speed,voice,docs] - name: "Get locales" run: | make html sphinx-build -b gettext . ./build/locales working-directory: ./docs - name: "Build locales" run: sphinx-intl update -p ./build/locales ${{ vars.SPHINX_LANGUAGES }} working-directory: ./docs - name: "Crowdin" uses: crowdin/github-action@52aa776766211d83d975df51f3b9c53c2f8ba35f # v2.16.3 with: upload_sources: true upload_translations: false download_translations: false localization_branch_name: ${{ vars.CROWDIN_LOCALIZATION_BRANCH }} create_pull_request: false config: "crowdin.yml" env: GITHUB_TOKEN: ${{ secrets.CI_TOKEN }} CROWDIN_PROJECT_ID: ${{ vars.CROWDIN_PROJECT_ID }} CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_API_TOKEN }}
What changed
- Run on Latchkey managed runners with one line (
runs-on), which apply the fixes below automatically and self-heal transient failures. This example useslatchkey-small; pick the runner size that fits the job. - Cancel superseded runs when a branch or PR gets a newer push.
- Add a job timeout so a hung step cannot burn hours of runner time.
What Latchkey heals here
This workflow has steps that commonly fail on transient issues (network, registries, flaky browsers). On Latchkey managed runners they are detected, retried, and self-healed instead of failing your build:
- Dependency installs
This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.