Skip to content

Commit 666b0c6

Browse files
committed
Prepare for multirepo builds
1 parent bd5b70f commit 666b0c6

File tree

3 files changed

+111
-21
lines changed

3 files changed

+111
-21
lines changed

.github/workflows/mkdocs-release.yml

Lines changed: 59 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ name: mkdocs-release
33
on:
44
push:
55
branches: [branch-*\.*]
6+
repository_dispatch:
7+
types:
8+
- trigger-rebuild
69

710
concurrency:
811
group: ${{ github.workflow }}
@@ -13,25 +16,72 @@ jobs:
1316
runs-on: ubuntu-latest
1417

1518
steps:
16-
- uses: actions/checkout@v4
19+
- name: Extract branch name (push)
20+
if: ${{ github.event_name == 'push' }}
21+
run: echo "BRANCH=${GITHUB_REF#refs/heads/}}" >> "$GITHUB_ENV"
22+
23+
- name: Extract branch name (repository_dispatch)
24+
if: ${{ github.event_name == 'repository_dispatch' }}
25+
run: echo "BRANCH=${{ github.event.client_payload.branch }}" >> "$GITHUB_ENV"
26+
27+
- name: Extract version from branch name
28+
run: echo "HOPSWORKS_VERSION=${BRANCH#branch-}}" >> "$GITHUB_ENV"
29+
30+
- name: Checkout main repo
31+
uses: actions/checkout@v4
1732
with:
1833
fetch-depth: 0
34+
ref: ${{ env.BRANCH }}
35+
36+
- name: Checkout the API repo
37+
uses: actions/checkout@v4
38+
with:
39+
# TODO: replace aversey with logicalclocks
40+
repository: aversey/hopsworks-api
41+
ref: ${{ env.BRANCH }}
42+
path: hopsworks-api
43+
44+
- name: Cache local Maven repository
45+
uses: actions/cache@v4
46+
with:
47+
path: ~/.m2/repository
48+
key: ${{ runner.os }}-maven-${{ hashFiles('java/pom.xml') }}
49+
restore-keys: |
50+
${{ runner.os }}-maven-
51+
52+
- name: Set up JDK 8
53+
uses: actions/setup-java@v5
54+
with:
55+
java-version: "8"
56+
distribution: "adopt"
57+
58+
- name: Build javadoc documentation
59+
working-directory: hopsworks-api/java
60+
run: mvn clean install javadoc:javadoc javadoc:aggregate -DskipTests && cp -r target/site/apidocs ../../docs/javadoc
1961

2062
- uses: actions/setup-python@v5
2163
with:
2264
python-version: "3.10"
2365

24-
- name: Install ubuntu dependencies
25-
run: sudo apt update && sudo apt-get install -y libxml2-dev libxslt-dev
66+
- name: Install uv
67+
uses: astral-sh/setup-uv@v7
68+
with:
69+
activate-environment: true
70+
working-directory: hopsworks-api/python
2671

27-
- name: install deps
28-
run: pip3 install -r requirements-docs.txt
72+
- name: Install Python API dependencies
73+
run: uv sync --extra dev --group docs --project hopsworks-api/python
74+
75+
- name: Install Python dependencies
76+
run: uv pip install -r requirements-docs.txt
77+
78+
- name: Install Ubuntu dependencies
79+
run: sudo apt update && sudo apt-get install -y libxml2-dev libxslt-dev
2980

30-
- name: setup git
81+
- name: Setup git for mike
3182
run: |
3283
git config --global user.name Mike
3384
git config --global user.email mike@docs.hopsworks.ai
3485
35-
# Put this back and increment version when cutting a new release branch
36-
# - name: mike deploy docs
37-
# run: mike deploy 3.0 latest -u --push
86+
- name: Deploy the docs with mike
87+
run: mike deploy ${HOPSWORKS_VERSION} latest -u --push

.github/workflows/mkdocs-test.yml

Lines changed: 51 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,60 @@ jobs:
1212
with:
1313
fetch-depth: 0
1414

15+
- name: Checkout the API repo
16+
uses: actions/checkout@v4
17+
with:
18+
# TODO: replace aversey with logicalclocks
19+
repository: aversey/hopsworks-api
20+
ref: ${{ github.base_ref }}
21+
path: hopsworks-api
22+
23+
- name: Markdownlint
24+
uses: DavidAnson/markdownlint-cli2-action@v9
25+
with:
26+
globs: '**/*.md'
27+
28+
- name: Cache local Maven repository
29+
uses: actions/cache@v4
30+
with:
31+
path: ~/.m2/repository
32+
key: ${{ runner.os }}-maven-${{ hashFiles('java/pom.xml') }}
33+
restore-keys: |
34+
${{ runner.os }}-maven-
35+
36+
- name: Set up JDK 8
37+
uses: actions/setup-java@v5
38+
with:
39+
java-version: "8"
40+
distribution: "adopt"
41+
42+
- name: Build javadoc documentation
43+
working-directory: hopsworks-api/java
44+
run: mvn clean install javadoc:javadoc javadoc:aggregate -DskipTests && cp -r target/site/apidocs ../../docs/javadoc
45+
1546
- uses: actions/setup-python@v5
1647
with:
1748
python-version: "3.10"
1849

19-
- name: Install ubuntu dependencies
20-
run: sudo apt update && sudo apt-get install -y libxml2-dev libxslt-dev
50+
- name: Install uv
51+
uses: astral-sh/setup-uv@v7
52+
with:
53+
activate-environment: true
54+
working-directory: hopsworks-api/python
2155

22-
- name: install deps
23-
run: pip3 install -r requirements-docs.txt
56+
- name: Install Python API dependencies
57+
run: uv sync --extra dev --group docs --project hopsworks-api/python
2458

25-
- name: setup git
26-
run: |
27-
git config --global user.name Mike
28-
git config --global user.email mike@docs.hopsworks.ai
59+
- name: Install Python dependencies
60+
run: uv pip install -r requirements-docs.txt
61+
62+
- name: Install Ubuntu dependencies
63+
run: sudo apt update && sudo apt-get install -y libxml2-dev libxslt-dev
2964

30-
- name: test broken links
65+
- name: Check for broken links
3166
run: |
3267
# run the server
33-
mkdocs serve > /dev/null 2>&1 &
68+
mkdocs serve > /dev/null 2>&1 &
3469
SERVER_PID=$!
3570
echo "mk server in PID $SERVER_PID"
3671
# Give enough time for deployment
@@ -41,5 +76,10 @@ jobs:
4176
# If ok just kill the server
4277
kill -9 $SERVER_PID
4378
44-
- name: mike deploy docs
79+
- name: Setup git for mike
80+
run: |
81+
git config --global user.name Mike
82+
git config --global user.email mike@docs.hopsworks.ai
83+
84+
- name: Generate the docs with mike
4585
run: mike deploy 3.2-SNAPSHOT dev -u

mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ nav:
252252
- Access Audit Logs: setup_installation/admin/audit/audit-logs.md
253253
- Export Audit Logs: setup_installation/admin/audit/export-audit-logs.md
254254
- Python API: '!import https://github.com/aversey/hopsworks-api?branch=multirepo-mkdocs'
255-
- Java API: https://docs.hopsworks.ai/hopsworks-api/latest/javadoc/
255+
- Java API: /javadoc/
256256
- Community ↗: https://community.hopsworks.ai/
257257

258258
theme:

0 commit comments

Comments
 (0)