This is an automated email from the ASF dual-hosted git repository.

lzljs3620320 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink-table-store.git


The following commit(s) were added to refs/heads/master by this push:
     new fa63371  [FLINK-26918] Add documentation build to Github Actions
fa63371 is described below

commit fa63371b95beac34e0efa9660112e2434039d937
Author: Jingsong Lee <[email protected]>
AuthorDate: Wed Mar 30 16:01:53 2022 +0800

    [FLINK-26918] Add documentation build to Github Actions
    
    This closes #68
---
 .github/workflows/docs.sh  | 39 ++++++++++++++++++++++++++
 .github/workflows/docs.yml | 69 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 108 insertions(+)

diff --git a/.github/workflows/docs.sh b/.github/workflows/docs.sh
new file mode 100755
index 0000000..c677a31
--- /dev/null
+++ b/.github/workflows/docs.sh
@@ -0,0 +1,39 @@
+#!/usr/bin/env bash
+################################################################################
+#  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.
+################################################################################
+set -e
+
+mvn --version
+java -version
+javadoc -J-version
+
+# setup hugo
+HUGO_REPO=https://github.com/gohugoio/hugo/releases/download/v0.80.0/hugo_extended_0.80.0_Linux-64bit.tar.gz
+HUGO_ARTIFACT=hugo_extended_0.80.0_Linux-64bit.tar.gz
+if ! curl --fail -OL $HUGO_REPO ; then
+       echo "Failed to download Hugo binary"
+       exit 1
+fi
+tar -zxvf $HUGO_ARTIFACT
+git submodule update --init --recursive
+# generate docs into docs/target
+./hugo -v --source docs --destination target
+if [ $? -ne 0 ]; then
+       echo "Error building the docs"
+       exit 1
+fi
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
new file mode 100644
index 0000000..8f9cd37
--- /dev/null
+++ b/.github/workflows/docs.yml
@@ -0,0 +1,69 @@
+# 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: "Build documentation"
+on:
+  schedule:
+    - cron: '0 0 * * *' # Deploy every day
+
+jobs:
+  build-documentation:
+    if: github.repository == 'apache/flink-table-store'
+    runs-on: ubuntu-latest
+    strategy:
+      max-parallel: 1
+      matrix:
+        branch:
+          - master
+          - release-0.1
+    steps:
+      - uses: actions/checkout@v3
+        with:
+          ref: ${{ matrix.branch }}
+      - name: Set branch environment variable
+        run: |
+          currentBranch=$(git branch --show-current)
+
+          echo "flink_table_store_branch=${currentBranch}" >> ${GITHUB_ENV}
+
+          if [ "${currentBranch}" = "master" ]; then
+            echo "flink_table_store_alias=release-0.2" >> ${GITHUB_ENV}
+          elif [ "${currentBranch}" = "release-0.1" ]; then
+            echo "flink_table_store_alias=stable" >> ${GITHUB_ENV}
+          fi
+      - name: Build documentation
+        run: |
+          docker run  --rm --volume "$PWD:/root/flink-table-store" 
chesnay/flink-ci:java_8_11 bash -c "cd /root/flink-table-store && 
./.github/workflows/docs.sh"
+      - name: Upload documentation
+        uses: burnett01/[email protected]
+        with:
+          switches: --archive --compress
+          path: docs/target/
+          remote_path: ${{ secrets.NIGHTLIES_RSYNC_PATH 
}}/flink/flink-table-store-docs-${{ env.flink_table_store_branch }}/
+          remote_host: ${{ secrets.NIGHTLIES_RSYNC_HOST }}
+          remote_port: ${{ secrets.NIGHTLIES_RSYNC_PORT }}
+          remote_user: ${{ secrets.NIGHTLIES_RSYNC_USER }}
+          remote_key: ${{ secrets.NIGHTLIES_RSYNC_KEY }}
+      - name: Upload documentation alias
+        if: env.flink_table_store_alias != ''
+        uses: burnett01/[email protected]
+        with:
+          switches: --archive --compress
+          path: docs/target/
+          remote_path: ${{ secrets.NIGHTLIES_RSYNC_PATH 
}}/flink/flink-table-store-docs-${{ env.flink_table_store_alias }}/
+          remote_host: ${{ secrets.NIGHTLIES_RSYNC_HOST }}
+          remote_port: ${{ secrets.NIGHTLIES_RSYNC_PORT }}
+          remote_user: ${{ secrets.NIGHTLIES_RSYNC_USER }}
+          remote_key: ${{ secrets.NIGHTLIES_RSYNC_KEY }}

Reply via email to