|
23 | 23 | build-documentation:
|
24 | 24 | if: github.repository == 'apache/flink-kubernetes-operator'
|
25 | 25 | 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 |
26 | 29 | strategy:
|
27 | 30 | max-parallel: 1
|
28 | 31 | matrix:
|
|
31 | 34 | - release-1.13
|
32 | 35 | - release-1.12
|
33 | 36 | 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 |
35 | 43 | with:
|
36 | 44 | ref: ${{ matrix.branch }}
|
37 | 45 | - name: Set branch environment variable
|
|
49 | 57 | fi
|
50 | 58 | - name: Build documentation
|
51 | 59 | 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 |
53 | 88 | - name: Upload documentation
|
54 | 89 | uses: ./.github/actions/rsync-deployments
|
55 | 90 | with:
|
|
0 commit comments