-
Notifications
You must be signed in to change notification settings - Fork 0
132 lines (116 loc) · 3.97 KB
/
documentation.yaml
File metadata and controls
132 lines (116 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: documentation
on:
push:
branches:
# - "develop/**" # For testing
- "master"
paths:
# Documentation
# Doc - CI workflow
- ".github/workflows/documentation.yaml"
- "scripts/ci/**documentation**.sh"
# Doc - Content
- "docs/**/*.md"
# Doc - MkDoc config
- "mkdocs.yml"
# Python source code package info
- "**/__pkg_info__.py"
env:
RELEASE_TYPE: python-package
PYTHON_PACKAGE_NAME: fake_api_server
SOFTWARE_VERSION_FORMAT: general-3
RUNNING_MODE: dry-run
permissions:
contents: write
id-token: write
pages: write
jobs:
deploy_latest_documentation:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Install Python 3.13
uses: actions/setup-python@v6
with:
python-version: "3.13"
- name: Install Python dependencies about Poetry
run: |
python3 -m pip install --upgrade pip
pip3 install -U pip
pip install -U poetry
- name: Build Python runtime environment and dependencies by Poetry
run: |
poetry --version
poetry install --with docs
# build and commit documentation with versioning
- name: Build versioning documentation
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
echo "Documentation tool version info:"
poetry run mkdocs --version
poetry run mike --version
bash ./scripts/ci/deploy-latest-version-documentation.sh
check_version-state:
# name: Check the version update state
uses: Chisanan232/GitHub-Action_Reusable_Workflows-Python/.github/workflows/rw_checking_deployment_state.yaml@v7.3
with:
library-name: fake-api-server
library-source-code-path: ./fake_api_server
check_version_info:
# name: Check the package version info to make sure whether it should release Docker image or not.
needs: check_version-state
if: ${{ needs.check_version-state.outputs.version_update_state == 'VERSION UPDATE' }}
uses: Chisanan232/GitHub-Action_Reusable_Workflows-Python/.github/workflows/rw_build_git-tag_and_create_github-release.yaml@v7.3
secrets:
github_auth_token: ${{ secrets.GITHUB_TOKEN }}
with:
project_type: python-package
project_name: fake_api_server
software_version_format: general-3
debug_mode: true
deploy_stable_documentation:
needs: check_version_info
if: ${{ needs.check_version_info.outputs.python_release_version == 'Official-Release' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Install Python 3.12
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install Python dependencies about Poetry
run: |
python3 -m pip install --upgrade pip
pip3 install -U pip
pip install -U poetry
- name: Build Python runtime environment and dependencies by Poetry
run: |
poetry --version
poetry install --with docs
# build and commit documentation with versioning
- name: Build versioning documentation
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
echo "Documentation tool version info:"
poetry run mkdocs --version
poetry run mike --version
bash ./scripts/ci/deploy-stable-version-documentation.sh \
-r '${{ env.RELEASE_TYPE }}' \
-p '${{ env.PYTHON_PACKAGE_NAME }}' \
-v '${{ env.SOFTWARE_VERSION_FORMAT }}' \
# -d '${{ env.RUNNING_MODE }}'
# # general build and deploy documentation to GitHub Page
# - name: Deploy documentation
# env:
# GH_TOKEN: ${{ secrets.GH_TOKEN }}
# run: |
# poetry run mkdocs gh-deploy --clean --force --ignore-version
# poetry run mkdocs --version