-
Notifications
You must be signed in to change notification settings - Fork 2
109 lines (108 loc) · 3.63 KB
/
api-docs.yml
File metadata and controls
109 lines (108 loc) · 3.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
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
---
name: API Docs
env:
DEFAULT_KHIOPS_PYTHON_TUTORIAL_REVISION: 11.0.0.0
DEFAULT_KHIOPS_SAMPLES_REVISION: 11.0.0
on:
workflow_dispatch:
inputs:
khiops-python-tutorial-revision:
default: 11.0.0.0
description: khiops-python-tutorial repo revision
khiops-samples-revision:
default: 11.0.0
description: khiops-samples repo revision
image-tag:
default: latest
description: Development Docker Image Tag
pull_request:
paths:
- doc/**.rst
- doc/create-doc
- doc/clean-doc
- doc/*.py
- khiops/**.py
- .github/workflows/api-docs.yml
push:
tags: ['*']
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
id-token: write
packages: read
pages: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest
# queued. However, do NOT cancel in-progress runs as we want to allow these production deployments
# to complete.
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-22.04
container:
# 'latest' default image tag cannot be set as an environment variable,
# because the `env` context is only accessible at the step level;
# hence, it is hard-coded
image: |-
ghcr.io/khiopsml/khiops-python/khiopspydev-ubuntu22.04:${{ inputs.image-tag || 'latest' }}
# Use the 'runner' user (1001) from github so checkout actions work properly
# https://github.com/actions/runner/issues/2033#issuecomment-1598547465
options: --user 1001
steps:
- name: Checkout khiops-python
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Add pip scripts directory to path
run: echo PATH="$PATH:/github/home/.local/bin" >> "$GITHUB_ENV"
- name: Install doc build requirements
run: |
# Install package itself to install the samples datasets
python -m pip install --upgrade pip
python -m pip install --user .
kh-download-datasets --force-overwrite --version ${{ inputs.khiops-samples-revision || env.DEFAULT_KHIOPS_SAMPLES_REVISION }}
kh-status
# Install the doc python requirements
cd doc
python -m pip install -U -r requirements.txt
# Clone the Khiops Python tutorial repository while building the documentation
- name: Build Sphinx Documentation
run: |
cd doc
./create-doc -t -d -g \
${{ inputs.khiops-python-tutorial-revision || env.DEFAULT_KHIOPS_PYTHON_TUTORIAL_REVISION }}
- name: Upload the docs as an artifact
uses: actions/upload-artifact@v4
with:
name: api-docs
path: ./doc/_build/html/
# Release on Git tag
release:
if: github.ref_type == 'tag'
needs: build
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- name: Download docs artifact
uses: actions/download-artifact@v4
with:
name: api-docs
path: ./doc/_build/html/
- name: Create docs release zip archive
uses: thedoctor0/zip-release@0.7.6
with:
type: zip
path: ./doc/_build/html/
filename: khiops-api-docs-${{ github.ref_name }}.zip
- name: Release the docs zip archive
uses: ncipollo/release-action@v1.15.0
with:
allowUpdates: true
artifacts: ./khiops-api-docs-${{ github.ref_name }}.zip
body: '**For testing purposes only**'
draft: false
makeLatest: false
prerelease: true
updateOnlyUnreleased: true