refacctor nightly build #9
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: Translate README | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- tcpserver-master-build | |
paths: | |
- 'README.md' | |
jobs: | |
translate: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Install markdown-translator | |
run: npm install -g markdown-translator | |
- name: Translate README | |
run: | | |
md-translator set --key ${{ secrets.AZURE_TRANSLATOR_KEY }} | |
md-translator set --region westeurope | |
md-translator translate --src README.md --dest README-FR.md --from en-US --to fr-FR | |
md-translator translate --src README.md --dest README-DE.md --from en-US --to de-DE | |
md-translator translate --src README.md --dest README-NL.md --from en-US --to nl-NL | |
md-translator translate --src README.md --dest README-TW.md --from en-US --to zh-TW | |
md-translator translate --src README.md --dest README-ZH.md --from en-US --to zh-CN | |
md-translator translate --src README.md --dest README-RU.md --from en-US --to ru-RU | |
- name: Commit and push changes | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add README-FR.md README-DE.md README-NL.md README-TW.md README-ZH.md | |
git commit -m "Translate README.md" | |
git push |