-
Notifications
You must be signed in to change notification settings - Fork 185
115 lines (104 loc) · 3.97 KB
/
docs-release.yml
File metadata and controls
115 lines (104 loc) · 3.97 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
#===============================================================================
# Copyright 2024 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#===============================================================================
name: Docs Release
on:
push:
tags:
- '[0-9][0-9][0-9][0-9]\.[0-9][0-9]?\.[0-9]' # Trigger on tag pushes
workflow_dispatch:
inputs:
doc_version:
description: 'Tag version (e.g. 2024.10.0)'
required: true
permissions: read-all
jobs:
build-docs:
runs-on: ubuntu-24.04
permissions:
contents: write
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
env:
TEMP_DOC_FOLDER: /tmp/_site
steps:
- name: Checkout Repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0 # Ensures all tags are fetched
- name: Set Up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.11"
- name: Install System Dependencies
run: sudo apt-get update && sudo apt-get install -y clang-format pandoc
- name: Extract Tag Version
run: |
if [ -n "${{ github.event.inputs.doc_version }}" ]; then
export DOC_VERSION="${{ github.event.inputs.doc_version }}"
echo "Manual dispatch detected with version: $DOC_VERSION"
else
export DOC_VERSION="${GITHUB_REF#refs/tags/}"
echo "Tag trigger detected with version: $DOC_VERSION"
fi
# Error out if cannot find version
if [ -z "$DOC_VERSION" ]; then
echo "::error: Failed to determine documentation version."
exit 1
fi
export SHORT_DOC_VERSION=$(echo "$DOC_VERSION" | awk -F'.' '{print $1"."$2}')
# export env var in other files
echo "DOC_VERSION=$DOC_VERSION" >> $GITHUB_ENV
echo "SHORT_DOC_VERSION=$SHORT_DOC_VERSION" >> $GITHUB_ENV
- name: Checkout release branch
run: |
if git checkout $DOC_VERSION 2>/dev/null; then
echo "Successfully checked out tag $DOC_VERSION."
else
echo "::error:: Tag $DOC_VERSION does not exist."
exit 1
fi
git branch
- name: Install Python Dependencies
run: |
pip install daal-devel impi-devel
pip install -r dependencies-dev
pip install -r requirements-doc.txt
- name: Build daal4py/sklearnex
run: |
export DALROOT=$(dirname $(dirname $(which python)))
export LD_LIBRARY_PATH=$(dirname $(dirname $(which python)))/lib:$LD_LIBRARY_PATH
./conda-recipe/build.sh
- name: Build scikit-learn-intelex Documentation
run: |
export LD_LIBRARY_PATH=$(dirname $(dirname $(which python)))/lib:$LD_LIBRARY_PATH
cd doc
./build-doc.sh --gh-pages
- name: Setup Pages
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0
- name: Prepare Documentation for Deployment
run: |
chmod +x .github/scripts/doc_release.sh
./.github/scripts/doc_release.sh
- name: Upload artifact for GitHub Pages
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0
with:
path: ${{ env.TEMP_DOC_FOLDER }}
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5