Skip to content

Commit 4f640e2

Browse files
committed
[SPARK-49495][DOCS] Document and Feature Preview on the master branch via Live GitHub Pages Updates
### What changes were proposed in this pull request? This pull request introduces functionalities that enable 'Document and Feature Preview on the master branch via Live GitHub Pages Updates'. ### Why are the changes needed? retore 8861f0f 3763827 58d73fe ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? https://github.com/yaooqinn/spark/actions/runs/10952355999 ### Was this patch authored or co-authored using generative AI tooling? no Closes apache#48175 from yaooqinn/SPARK-49495. Authored-by: Kent Yao <[email protected]> Signed-off-by: Kent Yao <[email protected]>
1 parent 1990646 commit 4f640e2

File tree

2 files changed

+99
-0
lines changed

2 files changed

+99
-0
lines changed

.asf.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ github:
3131
merge: false
3232
squash: true
3333
rebase: true
34+
ghp_branch: master
35+
ghp_path: /docs
3436

3537
notifications:
3638
pullrequests: [email protected]

.github/workflows/pages.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
20+
name: GitHub Pages deployment
21+
22+
on:
23+
push:
24+
branches:
25+
- master
26+
27+
concurrency:
28+
group: 'docs preview'
29+
cancel-in-progress: false
30+
31+
jobs:
32+
docs:
33+
name: Build and deploy documentation
34+
runs-on: ubuntu-latest
35+
permissions:
36+
id-token: write
37+
pages: write
38+
environment:
39+
name: github-pages # https://github.com/actions/deploy-pages/issues/271
40+
env:
41+
SPARK_TESTING: 1 # Reduce some noise in the logs
42+
RELEASE_VERSION: 'In-Progress'
43+
steps:
44+
- name: Checkout Spark repository
45+
uses: actions/checkout@v4
46+
with:
47+
repository: apache/spark
48+
ref: 'master'
49+
- name: Install Java 17
50+
uses: actions/setup-java@v4
51+
with:
52+
distribution: zulu
53+
java-version: 17
54+
- name: Install Python 3.9
55+
uses: actions/setup-python@v5
56+
with:
57+
python-version: '3.9'
58+
architecture: x64
59+
cache: 'pip'
60+
- name: Install Python dependencies
61+
run: |
62+
pip install 'sphinx==4.5.0' mkdocs 'pydata_sphinx_theme>=0.13' sphinx-copybutton nbsphinx numpydoc jinja2 markupsafe 'pyzmq<24.0.0' \
63+
ipython ipython_genutils sphinx_plotly_directive 'numpy>=1.20.0' pyarrow 'pandas==2.2.2' 'plotly>=4.8' 'docutils<0.18.0' \
64+
'flake8==3.9.0' 'mypy==1.8.0' 'pytest==7.1.3' 'pytest-mypy-plugins==1.9.3' 'black==23.9.1' \
65+
'pandas-stubs==1.2.0.53' 'grpcio==1.62.0' 'grpcio-status==1.62.0' 'grpc-stubs==1.24.11' 'googleapis-common-protos-stubs==2.2.0' \
66+
'sphinxcontrib-applehelp==1.0.4' 'sphinxcontrib-devhelp==1.0.2' 'sphinxcontrib-htmlhelp==2.0.1' 'sphinxcontrib-qthelp==1.0.3' 'sphinxcontrib-serializinghtml==1.1.5'
67+
- name: Install Ruby for documentation generation
68+
uses: ruby/setup-ruby@v1
69+
with:
70+
ruby-version: '3.3'
71+
bundler-cache: true
72+
- name: Install Pandoc
73+
run: |
74+
sudo apt-get update -y
75+
sudo apt-get install pandoc
76+
- name: Install dependencies for documentation generation
77+
run: |
78+
cd docs
79+
gem install bundler -v 2.4.22 -n /usr/local/bin
80+
bundle install --retry=100
81+
- name: Run documentation build
82+
run: |
83+
sed -i".tmp1" 's/SPARK_VERSION:.*$/SPARK_VERSION: '"$RELEASE_VERSION"'/g' docs/_config.yml
84+
sed -i".tmp2" 's/SPARK_VERSION_SHORT:.*$/SPARK_VERSION_SHORT: '"$RELEASE_VERSION"'/g' docs/_config.yml
85+
sed -i".tmp3" "s/'facetFilters':.*$/'facetFilters': [\"version:$RELEASE_VERSION\"]/g" docs/_config.yml
86+
sed -i".tmp4" 's/__version__: str = .*$/__version__: str = "'"$RELEASE_VERSION"'"/' python/pyspark/version.py
87+
cd docs
88+
SKIP_RDOC=1 bundle exec jekyll build
89+
- name: Setup Pages
90+
uses: actions/configure-pages@v5
91+
- name: Upload artifact
92+
uses: actions/upload-pages-artifact@v3
93+
with:
94+
path: 'docs/_site'
95+
- name: Deploy to GitHub Pages
96+
id: deployment
97+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)