Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 10 additions & 21 deletions .github/workflows/translation-cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,36 +69,25 @@ jobs:
sudo apt install tree -y

- name: Download files by comparing commits
uses: pingcap/docs-toolkit/actions/file-diff-update@main
with:
config_file: latest_translation_commit.json
working_directory: docs

- name: Show tmp directory structure
run: |
export GH_TOKEN=${{github.token}}
cd docs
npm i
node scripts/filterUpdateFiles.js
tree tmp
cd ..
- name: Copy new files to translator folder
run: |
cp -r docs/tmp docs-toolkit/markdown-translator/markdowns
- name: Copy variables.json to translator folder
run: |
cp docs/variables.json docs-toolkit/markdown-translator/markdowns/variables.json
if [ -f docs/tmp/variables.json ]; then
cp docs/tmp/variables.json docs-toolkit/markdown-translator/markdowns/variables.json
cp docs/tmp/variables.json docs/variables.json
fi
tree tmp || find tmp -type f | head -20
- name: Config and translate
run: |
cd docs-toolkit/markdown-translator
yarn
cd ../..
echo ${{secrets.GCP_KEY}} | base64 --decode >> key.json
export GOOGLE_APPLICATION_CREDENTIALS=key.json
export PROJECT_ID=${{ secrets.GCP_PROJECT_ID }}
export GLOSSARY_ID=${{ secrets.GCP_GLOSSARY_ID }}
yarn
node src/index_ja.js
cd ..
- name: Copy translated files to docs repo
run: |
cp -r docs-toolkit/markdown-translator/output/markdowns/* docs/
node docs-toolkit/markdown-translator/src/index_ja.js --input-dir docs/tmp --output-dir docs/

- name: Git commit and push
run: |
Expand Down
43 changes: 17 additions & 26 deletions .github/workflows/translation-zh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,40 +37,31 @@ jobs:
- run: |
sudo apt install tree -y

- name: Download files by comparing commits
- name: Download files
uses: pingcap/docs-toolkit/actions/file-diff-update@main
with:
config_file: latest_translation_commit.json
working_directory: docs
filter_by_cloud_toc: 'true'
files: ${{ inputs.file_names }}

- name: Show tmp directory structure
run: |
export GH_TOKEN=${{github.token}}
cd docs
npm i
if [ -n "${{ inputs.file_names }}" ]; then
node scripts/fetchFiles.js --files "${{ inputs.file_names }}"
else
node scripts/filterUpdateFiles.js --cloud
fi
tree tmp
cd ..
- name: Copy new files to translator folder
run: |
cp -r docs/tmp docs-toolkit/markdown-translator/markdowns
- name: Copy variables.json to translator folder
run: |
cp docs/variables.json docs-toolkit/markdown-translator/markdowns/variables.json
if [ -f docs/tmp/variables.json ]; then
cp docs/tmp/variables.json docs-toolkit/markdown-translator/markdowns/variables.json
cp docs/tmp/variables.json docs/variables.json
fi
tree tmp || find tmp -type f | head -20
- name: Config and translate
run: |
cd docs-toolkit/markdown-translator
yarn
cd ../..
echo ${{secrets.GCP_KEY}} | base64 --decode >> key.json
export GOOGLE_APPLICATION_CREDENTIALS=key.json
export PROJECT_ID=${{ secrets.GCP_PROJECT_ID }}
export GLOSSARY_ID=${{ secrets.GCP_GLOSSARY_ID }}
export LANGLINK_ACCESS_KEY=${{ secrets.LANGLINK_ACCESS_KEY }}
export LANGLINK_ACCESS_SECRET=${{ secrets.LANGLINK_ACCESS_SECRET }}
export LANGLINK_USER=${{ secrets.LANGLINK_USER }}
yarn
node src/index.js
cd ..
- name: Copy translated files to docs repo
run: |
cp -r docs-toolkit/markdown-translator/output/markdowns/* docs/
node docs-toolkit/markdown-translator/src/index.js --input-dir docs/tmp --output-dir docs/

- name: Set build ID
id: build_id
Expand Down
142 changes: 0 additions & 142 deletions scripts/fetchFiles.js

This file was deleted.

Loading