forked from apache/sedona
-
Notifications
You must be signed in to change notification settings - Fork 1
143 lines (136 loc) · 5.22 KB
/
docs.yml
File metadata and controls
143 lines (136 loc) · 5.22 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
133
134
135
136
137
138
139
140
141
142
143
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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 build
on:
push:
branches:
- master
- branch-*
pull_request:
branches:
- '*'
env:
MAVEN_OPTS: -Dmaven.wagon.httpconnectionManager.ttlSeconds=60
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '11'
- name: Compile JavaDoc
run: mvn -q clean install -DskipTests && mkdir -p docs/api/javadoc/spark && cp -r spark/common/target/apidocs/* docs/api/javadoc/spark/
- name: Compile ScalaDoc
run: mvn generate-sources scala:doc -pl !common,!snowflake,!flink && mkdir -p docs/api/scaladoc/spark && cp -r spark/common/target/site/scaladocs/* docs/api/scaladoc/spark
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
cache-dependency-path: 'docs-overrides/package-lock.json'
- name: Install docs-overrides dependencies
run: |
cd docs-overrides
npm ci
- name: Build docs-overrides assets
run: |
cd docs-overrides
npx gulp build
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Sync doc environment
run: uv sync --group docs
- run: sudo apt update
- uses: r-lib/actions/setup-r@v2.11.3
with:
r-version: release
use-public-rspm: true
- name: Query R dependencies
uses: r-lib/actions/setup-r-dependencies@v2.11.3
with:
cache: true
extra-packages: |
any::pkgdown
working-directory: './R'
- run: Rscript -e 'pkgdown::build_site(pkg = "./R", preview = FALSE, override = list(destination = "../docs/api/rdocs"))'
- name: Install Python documentation dependencies
run: |
# Get Spark version from pom.xml
SPARK_VERSION=$(mvn help:evaluate -Dexpression=spark.version -q -DforceStdout)
# Install pyspark matching Spark version (other deps handled by uv sync)
uv pip install pyspark==$SPARK_VERSION
# Install sedona with all optional dependencies for complete documentation
uv pip install -e python/.[all]
- name: Build Python API documentation with Sphinx
env:
CI: true
run: |
# Use uv run so sphinx-build from the virtual environment is on PATH
uv run bash -c 'cd python/sedona/doc && make clean && make html'
mkdir -p docs/api/pydocs
cp -r python/sedona/doc/_build/html/* docs/api/pydocs/
- run: git config --global user.name = "GitHub Action"
- run: git config --global user.email = "test@abc.com"
- run: uv run mkdocs build
- name: Deploy the doc to the website branch
if: ${{ github.event_name != 'pull_request' && github.repository == 'apache/sedona' }}
run: |
if [[ "${GITHUB_REF##*/}" == "master" ]]; then
git fetch origin website --depth=1
uv run mike deploy latest-snapshot -b website -p
elif [[ "${GITHUB_REF##*/}" =~ ^branch-[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
git fetch origin website --depth=1
version="${GITHUB_REF##*/branch-}"
uv run mike deploy --update-aliases "$version" latest -b website -p
fi
- run: mkdir staging
- run: cp -r site/* staging/
- uses: actions/upload-artifact@v4
with:
name: generated-docs
path: staging
- name: Cache Python packages
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Cache Node modules
uses: actions/cache@v4
with:
path: docs-overrides/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('docs-overrides/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-