-
-
Notifications
You must be signed in to change notification settings - Fork 78
68 lines (66 loc) · 1.81 KB
/
sync.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Reusable workflow example
on:
workflow_call:
inputs:
version:
required: true
type: string
tx_project:
required: true
type: string
secrets:
TRANSIFEX_APIKEY:
required: true
jobs:
sync:
runs-on: ubuntu-latest
env:
LOCALE: zh_CN
VERSION: ${{ inputs.version }}
steps:
- uses: actions/checkout@v4
- name: Checkout CPython
uses: actions/checkout@v4
with:
repository: 'python/cpython'
ref: ${{env.VERSION}}
path: cpython
- uses: actions/cache/restore@v4
with:
path: |
cpython/Doc/build
docs
key: cache-${{ inputs.version }}-${{ github.run_id }}
restore-keys: cache-${{ inputs.version }}-
- name: Checkout Current Branch
uses: actions/checkout@v4
with:
ref: ${{env.VERSION}}
path: docs
clean: false
- name: prepare
run: .github/scripts/prepare.sh
- name: update
run: .github/scripts/update.sh
env:
TX_TOKEN: ${{ secrets.TRANSIFEX_APIKEY }}
- uses: actions/cache/restore@v4
with:
path: cpython/Doc/build
key: cache-${{ inputs.version }}-${{ github.run_id }}
restore-keys: cache-${{ inputs.version }}-
- name: build
run: .github/scripts/build.sh
- uses: actions/cache/save@v4
with:
path: |
cpython/Doc/build
docs
key: cache-${{ inputs.version }}-${{ github.run_id }}
- name: stat
run: python .github/scripts/tx_stat.py > ./docs/.stat.json
env:
TX_TOKEN: ${{ secrets.TRANSIFEX_APIKEY }}
TX_PROJECT: ${{ inputs.tx_project }}
- name: commit
run: .github/scripts/commit.sh