This is an automated email from the ASF dual-hosted git repository. xiangfu pushed a commit to branch dev in repository https://gitbox.apache.org/repos/asf/incubator-pinot-site.git
commit 3b6c3ea7d4a8817ac038f2e27bbfe5aa09ba4367 Author: Xiang Fu <xiangfu.1...@gmail.com> AuthorDate: Fri Apr 23 15:28:28 2021 -0700 adding github action to publish website --- .../workflows/website-publish.yml | 33 +++++++++++----------- website/scripts/build-site.sh | 8 ++---- website/scripts/publish_site.sh | 22 +++++++++++---- 3 files changed, 35 insertions(+), 28 deletions(-) diff --git a/website/scripts/build-site.sh b/.github/workflows/website-publish.yml old mode 100755 new mode 100644 similarity index 73% copy from website/scripts/build-site.sh copy to .github/workflows/website-publish.yml index 83842d2..199ccfd --- a/website/scripts/build-site.sh +++ b/.github/workflows/website-publish.yml @@ -1,4 +1,3 @@ -#!/bin/bash # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file @@ -18,19 +17,19 @@ # under the License. # -ROOT_DIR=$(git rev-parse --show-toplevel) - -VERSION=0.30 - -set -x -e - -cd ${ROOT_DIR}/website -npm install yarn -yarn install -yarn run build - -rm -rf ${ROOT_DIR}/content - -## copy generated site -cp -R build/ ${ROOT_DIR}/content/ - +name: Publish Website +on: + push: + branches: + - dev + pull_request: + branches: + - dev +jobs: + publish-website: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Website build + run: | + website/scripts/publish-site.sh diff --git a/website/scripts/build-site.sh b/website/scripts/build-site.sh index 83842d2..9943e0b 100755 --- a/website/scripts/build-site.sh +++ b/website/scripts/build-site.sh @@ -19,18 +19,14 @@ # ROOT_DIR=$(git rev-parse --show-toplevel) - -VERSION=0.30 - set -x -e - cd ${ROOT_DIR}/website npm install yarn yarn install yarn run build rm -rf ${ROOT_DIR}/content - ## copy generated site -cp -R build/ ${ROOT_DIR}/content/ +mv build ${ROOT_DIR}/content +cd ${ROOT_DIR} \ No newline at end of file diff --git a/website/scripts/publish_site.sh b/website/scripts/publish_site.sh index 9b3a87c..ed6d287 100644 --- a/website/scripts/publish_site.sh +++ b/website/scripts/publish_site.sh @@ -18,10 +18,19 @@ # under the License. # -set -e - +set -x -e +ls -lrth ROOT_DIR=$(git rev-parse --show-toplevel) -WORK_DIR=${ROOT_DIR}/build +cd ${ROOT_DIR}/website +npm install yarn +yarn install +yarn run build + +rm -rf ${ROOT_DIR}/content +## copy generated site +mv build ${ROOT_DIR}/content + +WORK_DIR=${ROOT_DIR}/content ME=`basename $0` echo "Basename $ME" @@ -40,12 +49,15 @@ SITE_TMP=/tmp/pinot-site git clone "https://$GH_TOKEN@$ORIGIN_REPO" . git config user.name "Pinot Site Updater" git config user.email "d...@pinot.apache.org" - git checkout asf-master + git checkout asf-site # Clean content directory rm -rf $SITE_TMP/content/ mkdir $SITE_TMP/content # Copy the generated directory to asf folder - cp -r $WORK_DIR/* $SITE_TMP/content + mv $WORK_DIR/content $SITE_TMP/content + git add . + git commit -m "Update Pinot Site" + git push origin asf-site ) \ No newline at end of file --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org