Skip to content

Commit f9d252d

Browse files
committed
Rework doc build to not use shell script and Docker img
1 parent c0161e1 commit f9d252d

File tree

2 files changed

+37
-55
lines changed

2 files changed

+37
-55
lines changed

.github/workflows/docs.sh

Lines changed: 0 additions & 53 deletions
This file was deleted.

.github/workflows/docs.yaml

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ jobs:
2323
build-documentation:
2424
if: github.repository == 'apache/flink-kubernetes-operator'
2525
runs-on: ubuntu-latest
26+
env:
27+
HUGO_REPO: https://github.com/gohugoio/hugo/releases/download/v0.104.0/hugo_extended_0.104.0_Linux-64bit.tar.gz
28+
HUGO_ARTIFACT: hugo_extended_0.104.0_Linux-64bit.tar.gz
2629
strategy:
2730
max-parallel: 1
2831
matrix:
@@ -31,7 +34,12 @@ jobs:
3134
- release-1.13
3235
- release-1.12
3336
steps:
34-
- uses: actions/checkout@v3
37+
- name: Set up Temurin JDK 17
38+
uses: actions/setup-java@v4
39+
with:
40+
distribution: temurin
41+
java-version: 17
42+
- uses: actions/checkout@v4
3543
with:
3644
ref: ${{ matrix.branch }}
3745
- name: Set branch environment variable
@@ -49,7 +57,34 @@ jobs:
4957
fi
5058
- name: Build documentation
5159
run: |
52-
docker run --rm --volume "$PWD:/root/flink-kubernetes-operator" chesnay/flink-ci:java_8_11 bash -c "cd /root/flink-kubernetes-operator && ./.github/workflows/docs.sh"
60+
if ! curl --fail -OL "$HUGO_REPO" ; then
61+
echo "Failed to download Hugo binary"
62+
exit 1
63+
fi
64+
tar -zxvf "$HUGO_ARTIFACT"
65+
git submodule update --init --recursive
66+
67+
# generate docs into docs/target
68+
./hugo -v --source docs --destination target
69+
if [ $? -ne 0 ]; then
70+
echo "Error building the docs"
71+
exit 1
72+
fi
73+
74+
# build Java docs
75+
mkdir -p docs/target/api
76+
77+
mvn javadoc:aggregate -B \
78+
-DadditionalJOption="-Xdoclint:none" \
79+
-DadditionalJOption="--allow-script-in-comments" \
80+
-DexcludePackageNames="org.apache.flink.examples" \
81+
-Dmaven.javadoc.failOnError=false \
82+
-Dcheckstyle.skip=true \
83+
-Dspotless.check.skip=true \
84+
-Denforcer.skip=true \
85+
-Dheader="<a href=\"http://flink.apache.org/\" target=\"_top\"><h1>Back to Flink Website</h1></a> <script>var _paq=window._paq=window._paq||[];_paq.push([\"disableCookies\"]),_paq.push([\"setDomains\",[\"*.flink.apache.org\",\"*.nightlies.apache.org/flink\"]]),_paq.push([\"trackPageView\"]),_paq.push([\"enableLinkTracking\"]),function(){var u=\"//matomo.privacy.apache.org/\";_paq.push([\"setTrackerUrl\",u+\"matomo.php\"]),_paq.push([\"setSiteId\",\"1\"]);var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s)}();</script>"
86+
87+
mv target/site/apidocs docs/target/api/java
5388
- name: Upload documentation
5489
uses: ./.github/actions/rsync-deployments
5590
with:

0 commit comments

Comments
 (0)