forked from apache/incubator-seata-website
-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (48 loc) · 1.41 KB
/
translate.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: translate
on:
push:
branches:
- translate
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Change permissions
run: chmod 755 docs
- name: Auto-i18n_translate
env:
# 设置环境变量
CHATGPT_API_KEY: ${{ secrets.CHATGPT_API_KEY }}
CHATGPT_API_BASE: ${{ secrets.CHATGPT_API_BASE }}
run: |
pip install -r requirements.txt
python auto-translater.py || true
- name: Commit translated
run: |
git config --global user.email [email protected]
git config --global user.name slievrly
git add .
git commit -m "Commit translated" || true
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.COMMIT_TOKEN }}
branch: translate_docs
- name: Install MkDocs dependencies
run: pip install -r requirements.txt
- name: Deploy with MkDocs
run: mkdocs gh-deploy --force