Repository navigation
60 lines (55 loc) 路 1.63 KB
/
Copy pathdocs.yaml
File metadata and controls
60 lines (55 loc) 路 1.63 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
name: Docs
on:
workflow_dispatch:
push:
branches:
- main
tags:
- "v*.*.*"
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v7
with:
python-version: "3.10"
- name: Install dependencies
run: |
pip install -e .[docs,examples]
- name: Make docs
run: |
mkdocs build
- name: Deploy to GitHub Pages
env:
CI: false
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PAGES_BRANCH: gh-pages
if: contains(github.ref, 'main') && github.event_name == 'push'
run: |
git config user.name doc-bot
git config user.email doc-bot@openml.com
current_version=$(git tag | sort --version-sort | tail -n 1)
# This block will rename previous retitled versions
retitled_versions=$(mike list -j | jq ".[] | select(.title != .version) | .version" | tr -d '"')
for version in $retitled_versions; do
mike retitle "${version}" "${version}"
done
echo "Deploying docs for ${current_version}"
mike set-default latest
mike deploy \
--push \
--title "${current_version} (latest)" \
--update-aliases \
"${current_version}" \
"latest"\
-b $PAGES_BRANCH