-
Notifications
You must be signed in to change notification settings - Fork 17
133 lines (118 loc) · 4.5 KB
/
build.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
name: build
on:
push:
branches:
- 'main'
schedule:
# everyday 9AM (UTC)
- cron: '* 9 * * *'
workflow_dispatch:
workflow_run:
workflows:
- 'sync-upstream'
branches:
- 'main'
types:
- completed
jobs:
update:
name: Update files
# Update job evaluates changes introduced in current revision and create cascading changes (commits) if necessary
runs-on: ubuntu-20.04
steps:
- name: Checkout
# Checkout target revision from git repository
uses: actions/checkout@v2
with:
fetch-depth: 0 # all history (required for getting last modified time of files)
- name: Cache bundle directory
# Cache ruby bundle directory to speed up build
uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
- name: Configure git
# Setup git configuration
run: |
bin/configure-git
- name: Setup build env
# Setup build environment(install runtime, library, etc.)
run: |
bin/setup-build-env
- name: Update tmx
# Update .tmx (translation memory) file from .po files
# Translation memory is a kind of dictionary consisted by pairs of a original text and a translated text.
# It will be used in sync workflow to fill a translated text to the updated .po files.
run: bin/update-tmx
- name: Push changes
# Commit and Push the .tmx file generated
run: bin/push-changes "Update tmx"
- name: Update translation stats
# Update the translation stats .csv file, which is used as an simplified dashboard ( https://github.com/quarkusio/cn.quarkus.io/blob/main/l10n/stats/translation.csv )
run: bin/update-translation-stats
- name: Push changes
# Commit and Push the translation stats .csv file
run: bin/push-changes "Update translation stats"
- name: Update override stats
# Some files cannot be translated by po4a utility.
# In that case, the files are copied to `l10n/override/<locale>/` directory and translated manually.
# This step updates the override stats .csv file, which depicts override files are up-to-date or not
run: |
bin/update-override-stats
- name: Create issue if override files updated
# Create a new issue if override files are updated to notify users the override files needs update
run: |
.github/steps/create-issue-if-override-files-updated
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Push changes
# Commit and Push the override stats .csv file
run: bin/push-changes "Update override stats"
deploy-cn:
name: Deploy Chinese translation to GitHub pages
# Deploy a localized site to the GitHub pages
runs-on: ubuntu-20.04
steps:
- name: Checkout
# Checkout target revision from git repository
uses: actions/checkout@v2
- name: Cache bundle directory
# Cache ruby bundle directory to speed up build
uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
- name: Setup build env
# Setup build environment(install runtime, library, etc.)
run: |
bin/setup-build-env
- name: Configure git
# Setup git configuration
run: |
bin/configure-git
- name: Exec po4a-translate
# Execute po4a-translate to translate files based on .po files
run: bin/exec-po4a-translate
- name: Apply override files
# Some files cannot be translated by po4a utility.
# In that case, the files are copied to `l10n/override/<locale>/` directory and translated manually
# This step copies the stored translated files to corresponding location.
run: bin/exec-override
- name: Exec jekyll
# Execute jekyll to build a localized site
run: bin/exec-jekyll
- name: Deploy to GitHub Pages
# Deploy the site to GitHub Pages by committing and pushing the site
run: |
echo "cn.quarkus.io" > docs/CNAME
git add -f docs
set +e
git diff --cached --exit-code --quiet
if [[ $? -eq 1 ]] ; then
set -e
git checkout -b docs
git commit -m "Update GitHub Pages"
git fetch
git push -f origin docs
fi
set -e