-
Notifications
You must be signed in to change notification settings - Fork 10
170 lines (145 loc) · 4.92 KB
/
localised.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
name: Localised Docs
on:
schedule:
- cron: '31 0 * * 0'
workflow_dispatch:
inputs:
Locale:
description: 'Locale to build'
required: true
default: 'fr'
type: choice
options:
- fr
- es_419
- pt
- cs
- zh
- ar
- ALL
jobs:
build-all-locales:
runs-on: ubuntu-20.04
strategy:
max-parallel: 1
matrix:
include:
- id: French
locale: fr
- id: Spanish
locale: es_419
- id: Portuguese
locale: pt
- id: Czech
locale: cs
- id: Chinese
locale: zh
- id: Arabic
locale: ar
fail-fast: false
# Updated if condition to handle workflow_dispatch
if: (github.event_name == 'schedule') || (github.event_name == 'workflow_dispatch' && github.event.inputs.Locale == 'ALL')
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Install custom pre-processor
run: |
cd tools/python/markdown-pp-master
python3 setup.py develop
pip install MarkdownPP
- name: Install markdown extensions
run: |
cd tools/python/markdown-extensions/d_card
python3 setup.py develop
pip install d_card
- name: Install dhis2_plugins for mkdocs
run: |
cd tools/python/dhis2_plugins
python3 setup.py develop
pip install dhis2_plugins
- name: Install markdown hacks
run: |
# temporary hacks
python3 -m site
cp tools/python/blockprocessors.py ${pythonLocation}/lib/python3.9/site-packages/markdown/
cp tools/python/attr_list.py ${pythonLocation}/lib/python3.9/site-packages/markdown/extensions/
cp tools/python/tables.py ${pythonLocation}/lib/python3.9/site-packages/markdown/extensions/
- name: Build the docs
run: |
mkdocs build
env:
DHIS2_DOCS_LANGUAGE: '${{ matrix.locale }}'
DHIS2_DOCS_TX_TOKEN: ${{ secrets.DHIS2_DOCS_TX_TOKEN }}
- name: Sync docs to S3
uses: dhis2/s3-sync-action@master
with:
args: --delete --exclude 'full*'
env:
AWS_S3_BUCKET: ${{ secrets.DHIS2_S3_DOCS_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.DHIS2_S3_DOCS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DHIS2_S3_DOCS_ACCESS_KEY }}
AWS_REGION: 'eu-west-1'
AWS_CF_DISTRIBUTION_ID: ${{ secrets.DHIS2_S3_DOCS_CF_ID }}
SOURCE_DIR: 'target/${{ matrix.locale }}/.'
DEST_DIR: '${{ matrix.locale }}/'
build-single-locale:
runs-on: ubuntu-20.04
# Updated if condition to handle workflow_dispatch
if: (github.event_name == 'workflow_dispatch' && github.event.inputs.Locale != 'ALL')
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Install custom pre-processor
run: |
cd tools/python/markdown-pp-master
python3 setup.py develop
pip install MarkdownPP
- name: Install markdown extensions
run: |
cd tools/python/markdown-extensions/d_card
python3 setup.py develop
pip install d_card
- name: Install dhis2_plugins for mkdocs
run: |
cd tools/python/dhis2_plugins
python3 setup.py develop
pip install dhis2_plugins
- name: Install markdown hacks
run: |
# temporary hacks
python3 -m site
cp tools/python/blockprocessors.py ${pythonLocation}/lib/python3.9/site-packages/markdown/
cp tools/python/attr_list.py ${pythonLocation}/lib/python3.9/site-packages/markdown/extensions/
cp tools/python/tables.py ${pythonLocation}/lib/python3.9/site-packages/markdown/extensions/
- name: Build the docs
run: |
mkdocs build
env:
DHIS2_DOCS_LANGUAGE: '${{ github.event.inputs.Locale }}'
DHIS2_DOCS_TX_TOKEN: ${{ secrets.DHIS2_DOCS_TX_TOKEN }}
- name: Sync docs to S3
uses: dhis2/s3-sync-action@master
with:
args: --delete --exclude 'full*'
env:
AWS_S3_BUCKET: ${{ secrets.DHIS2_S3_DOCS_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.DHIS2_S3_DOCS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DHIS2_S3_DOCS_ACCESS_KEY }}
AWS_REGION: 'eu-west-1'
AWS_CF_DISTRIBUTION_ID: ${{ secrets.DHIS2_S3_DOCS_CF_ID }}
SOURCE_DIR: 'target/${{ github.event.inputs.Locale }}/.'
DEST_DIR: '${{ github.event.inputs.Locale }}/'