-
Notifications
You must be signed in to change notification settings - Fork 108
153 lines (130 loc) · 4.46 KB
/
gh-pages.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
name: GitHub Pages
on:
push:
branches:
- master
- develop
paths:
- 'docs/**'
- 'src/main/resources/com/github/_1c_syntax/bsl/languageserver/configuration/**'
- 'src/main/java/**'
- 'mkdocs.yml'
- 'mkdocs.en.yml'
- '.github/workflows/gh-pages.yml'
jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup JDK
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
cache: gradle
- name: Build javadoc
run: ./gradlew --no-daemon javadoc
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.7.15'
architecture: 'x64'
- name: Install dependencies
run: |
pip install --upgrade pip
pip install mkdocs mkdocs-material pygments-bsl
- name: Dowload latest GitHub Pages
run: |
wget https://github.com/${{ github.repository }}/archive/gh-pages.zip || true
unzip gh-pages.zip || true
mkdir tmp-bench
- name: Save latest Develop
if: github.ref == 'refs/heads/master'
run: |
mkdir public
mkdir public/dev
cp -R ${GITHUB_REPOSITORY#*/}-gh-pages/dev/. public/dev || true
- name: Save latest Master
if: github.ref == 'refs/heads/develop'
run: |
mkdir public
cp -R ${GITHUB_REPOSITORY#*/}-gh-pages/. public || true
rm -rf public/dev || true
mkdir public/dev
- name: Backup benchmark (master)
if: github.ref == 'refs/heads/master'
run: |
cp -R ${GITHUB_REPOSITORY#*/}-gh-pages/bench/. tmp-bench || true
- name: Backup benchmark (develop)
if: github.ref == 'refs/heads/develop'
run: |
cp -R ${GITHUB_REPOSITORY#*/}-gh-pages/dev/bench/. tmp-bench || true
- name: Patch Develop
if: github.ref == 'refs/heads/develop'
run: |
sed -i "s%BSL Language Server%BSL Language Server Dev%g" mkdocs.yml
sed -i "s%BSL Language Server%BSL Language Server Dev%g" mkdocs.en.yml
sed -i "s%https://1c-syntax.github.io/bsl-language-server%https://1c-syntax.github.io/bsl-language-server/dev%g" mkdocs.yml
sed -i "s%https://1c-syntax.github.io/bsl-language-server%https://1c-syntax.github.io/bsl-language-server/dev%g" mkdocs.en.yml
sed -i "s%link: /bsl-language-server/%link: /bsl-language-server/dev/%g" mkdocs.yml
sed -i "s%link: /bsl-language-server/%link: /bsl-language-server/dev/%g" mkdocs.en.yml
- name: Build documentation
run: |
./gradlew generateDiagnosticDocs --build
./gradlew generateDiagnosticsIndex --build
- name: Build Russian
run: |
mkdir temp
cp mkdocs.yml temp
cp -R docs/. temp/docs
mkdir temp/docs/configuration
cp -R src/main/resources/com/github/_1c_syntax/bsl/languageserver/configuration/. temp/docs/configuration
rm -rf temp/docs/en
cd temp
mkdocs build
- name: Copy benchmark
run: |
cp -R tmp-bench/. temp/site/bench
rm -rf tmp-bench
- name: Copy javadoc
run: |
cp -R build/docs/javadoc temp/site/javadoc
echo "" > temp/site/.nojekyll
- name: Public Russian Master
if: github.ref == 'refs/heads/master'
run: |
cp -R temp/site/. public
- name: Public Russian Develop
if: github.ref == 'refs/heads/develop'
run: |
cp -R temp/site/. public/dev
- name: Clean temp
run: rm -rf temp
- name: Build English
run: |
mkdir temp
cp mkdocs.en.yml temp/mkdocs.yml
mkdir temp/docs
cp -R docs/en/. temp/docs
mkdir temp/docs/assets
cp -R docs/assets/. temp/docs/assets
mkdir temp/docs/configuration
cp -R src/main/resources/com/github/_1c_syntax/bsl/languageserver/configuration/. temp/docs/configuration
cd temp
mkdocs build
- name: Public English Master
if: github.ref == 'refs/heads/master'
run: |
mkdir public/en
cp -R temp/site/. public/en
- name: Public English Develop
if: github.ref == 'refs/heads/develop'
run: |
mkdir public/dev/en
cp -R temp/site/. public/dev/en
- name: Deploy
uses: peaceiris/[email protected]
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_branch: gh-pages
publish_dir: ./public