forked from 1c-syntax/mdclasses
-
Notifications
You must be signed in to change notification settings - Fork 0
129 lines (110 loc) · 3.44 KB
/
Copy pathgh-pages.yml
File metadata and controls
129 lines (110 loc) · 3.44 KB
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
name: GitHub Pages
on:
push:
branches:
- master
- develop
paths:
- 'docs/**'
- 'src/main/java/**'
- 'mkdocs.yml'
- 'mkdocs.en.yml'
- '.github/workflows/gh-pages.yml'
jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
- name: Setup JDK
uses: actions/setup-java@v2
with:
java-version: 16
distribution: 'adopt'
- name: Build javadoc
run: ./gradlew --no-daemon javadoc
- name: Set up Python
uses: actions/setup-python@v2.2.2
with:
python-version: '3.6'
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: Patch Develop
if: github.ref == 'refs/heads/develop'
run: |
sed -i "s%MDClasses%MDClasses Dev%g" mkdocs.yml
sed -i "s%MDClasses%MDClasses Dev%g" mkdocs.en.yml
sed -i "s%https://1c-syntax.github.io/mdclasses%https://1c-syntax.github.io/mdclasses/dev%g" mkdocs.yml
sed -i "s%https://1c-syntax.github.io/mdclasses%https://1c-syntax.github.io/mdclasses/dev%g" mkdocs.en.yml
sed -i "s%link: /mdclasses/%link: /mdclasses/dev/%g" mkdocs.yml
sed -i "s%link: /mdclasses/%link: /mdclasses/dev/%g" mkdocs.en.yml
- name: Build Russian
run: |
mkdir temp
cp mkdocs.yml temp
cp -R docs/ru/. temp/docs
mkdir temp/docs/assets
cp -R docs/assets/. temp/docs/assets
rm -rf temp/docs/en
cd temp
mkdocs build
- 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
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/actions-gh-pages@v3.8.0
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_branch: gh-pages
publish_dir: ./public