Build Translated Markdown #212
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: Build Translated Markdown | |
on: | |
pull_request: | |
types: [closed] | |
push: | |
branches: [l10n_main] | |
paths: | |
- '.github/workflows/**' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name != 'pull_request' || github.head_ref == 'l10n_main' }} | |
steps: | |
- name: Checkout Build | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
ref: build | |
- name: Checkout Submodules | |
run: git submodule update --init --recursive | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Setup Poetry | |
uses: abatilo/actions-poetry@v2 | |
with: | |
poetry-version: '1.3.2' | |
- name: Prepare Environment | |
run: | | |
poetry install | |
- name: Update | |
run: | | |
git config user.name github-actions | |
git config user.email github-actions@github.com | |
git fetch origin main | |
git merge origin/main --no-edit | |
- name: Build | |
env: | |
CROWDIN_TOKEN: ${{ secrets.CROWDIN_TOKEN }} | |
run: | | |
poetry run python3 build.py zh_TW | |
- name: Commit & Push | |
run: | | |
git add . | |
git commit -m "Build fresh translations" | |
git push origin build |