-
Notifications
You must be signed in to change notification settings - Fork 27
43 lines (36 loc) · 1.19 KB
/
translate_docs.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
name: Translate Markdown Files
on:
pull_request:
paths:
- 'docs/*/en/*.md'
jobs:
translate:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Set up credentials
run: echo "$GOOGLE_APPLICATION_CREDENTIALS" > credentials.json
env:
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
- name: Install dependencies
run: |
pip install --upgrade pip
pip install google-cloud-translate
pip install gitpython
pip install PyGithub
- name: Translate Markdown files
env:
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ secrets.GITHUB_REPOSITORY }}
GITHUB_BASE_REF: ${{ secrets.GITHUB_SHA }}
GITHUB_REF: ${{ secrets.GITHUB_REF }}
run: |
python translate_docs.py
- name: Remove credentials file
run: rm credentials.json