Skip to content

Commit e809d7c

Browse files
authored
elyra-ai#1932 Publish v13 Docs using mike (elyra-ai#1967)
Signed-off-by: srikant <[email protected]>
1 parent f445ddc commit e809d7c

File tree

4 files changed

+38
-6
lines changed

4 files changed

+38
-6
lines changed

.github/workflows/deploy-docs.yml

+9-4
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,20 @@ jobs:
3232
working-directory: ./docs
3333
steps:
3434
- uses: actions/checkout@v4
35-
- uses: actions/setup-python@v5
35+
# We need to additionally fetch the gh-pages branch for mike deploy
3636
with:
37-
python-version: 3.x
37+
fetch-depth: 0
38+
- name: Set up Python
39+
uses: actions/setup-python@v5
40+
with:
41+
python-version: 3.11
3842
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
3943
- uses: actions/cache@v4
4044
with:
4145
key: mkdocs-material-${{ env.cache_id }}
4246
path: .cache
4347
restore-keys: |
4448
mkdocs-material-
45-
- run: pip install mkdocs-material
46-
- run: mkdocs gh-deploy --force
49+
- run: pip3 install mkdocs-material
50+
run: pip3 install mike
51+
- run: mike deploy --push --update-aliases v13 latest

README.md

+18-2
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,26 @@ npm install
6666
3. Install required mkdocs packages using pip3.
6767
```
6868
pip3 install -r requirements.txt
69+
pip3 install mike
6970
```
7071

71-
4. Run below command to start mkdocs server.
72-
```
72+
4. Run below commands to use `mike` to deploy multiple versions of docs.
73+
```sh
74+
# Initially delete everything from gh-pages branch to start creating version folders.
75+
mike delete --all
76+
77+
# If above command throws an error please run below mkdocs command and then run mike deploy
78+
mkdocs gh-deploy --force
79+
80+
# This command will create a folder named as v13 in gh-pages branch.
81+
mike deploy --push --update-aliases v13 latest
82+
mike set-default v13
83+
84+
85+
# Test changes in local.
86+
mike serve
87+
88+
# If you are working on Elyra Canvas documentation content, you should run the following command, instead of the mike serve command, to see your changes immediately reflected in the browser.
7389
mkdocs serve
7490
```
7591

docs/mkdocs.yml

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ theme:
3333
- navigation.footer
3434

3535
extra:
36+
version:
37+
provider: mike
3638
social:
3739
- icon: fontawesome/brands/github
3840
link: http://github.com/elyra-ai/canvas

docs/pages/css/styles.css

+9
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,12 @@ th {
2222
max-width: 71rem;
2323
}
2424

25+
.md-version__list {
26+
background-color: black;
27+
}
28+
29+
.md-version__link {
30+
background-color: black;
31+
color: white;
32+
transition: color 0.3s ease;
33+
}

0 commit comments

Comments
 (0)