From 7ff6c2d3dceb8b358373583f3d04d9e983fd6789 Mon Sep 17 00:00:00 2001 From: gongzhongqiang Date: Sun, 7 Jan 2024 14:15:22 +0800 Subject: [PATCH] [FLINK-33970][jdbc][docs] Add hugo build check for connector docs --- .github/workflows/ci.yml | 81 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 80 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e9d1fcc..bcb6026 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,7 +77,7 @@ jobs: - run: echo "Running CI pipeline for JDK version ${{ matrix.jdk }}" - name: Check out repository code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: "${{ inputs.connector_branch }}" @@ -205,3 +205,82 @@ jobs: done fi exit 0 + + check_and_build_docs: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - name: Check out repository code + uses: actions/checkout@v4 + with: + ref: "${{ inputs.connector_branch }}" + + - name: Check dead links + run: | + sudo npm install -g markdown-link-check@3.10.0 + + echo '{ + "ignorePatterns": [ + { + "pattern": "^http://localhost" + }, + { + "pattern": "^https://mvnrepository.com" + }, + { + "pattern": "^https://img.shields.io" + }, + { + "pattern": "^https://tokei.rs" + }, + { + "pattern": "^https://json.org/" + }, + { + "pattern": "^https://opencollective.com" + } + ], + "timeout": "30s", + "retryOn429": true, + "retryCount": 10, + "fallbackRetryDelay": "1000s", + "aliveStatusCodes": [ + 0, + 200, + 401, + 403 + ] + }' > .dlc.json + + for file in $(find . -name "*.md"); do + markdown-link-check -c .dlc.json -q "$file" + done + + - name: Checkout flink docs + uses: actions/checkout@v4 + with: + repository: apache/flink + ref: master + sparse-checkout: | + docs + path: flink-docs + + - name: Prepare docs + run: | + git config --global --add safe.directory $(pwd)/flink-docs + cd $(pwd)/flink-docs + git submodule update --init --recursive + cd ./docs + source setup_hugo.sh + connector=`echo ${GITHUB_REPOSITORY} | cut -d- -f3-` + sed -i "/integrate_connector_docs $connector/d" setup_docs.sh + source setup_docs.sh + + - name: Rsync connector docs and build + run: | + if [ -d "$(pwd)/docs" ]; then + rsync -a $(pwd)/docs/* $(pwd)/flink-docs/docs/themes/connectors/ + fi + cd $(pwd)/flink-docs + hugo mod get -u + hugo --source docs