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 5a1127d9454dd22ba94018c1b4950f4b1dd6c318
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                  | 51 +++++++++-------------
 website/scripts/publish_site.sh                    |  7 ++-
 2 files changed, 25 insertions(+), 33 deletions(-)

diff --git a/website/scripts/publish_site.sh 
b/.github/workflows/website-publish.yml
similarity index 51%
copy from website/scripts/publish_site.sh
copy to .github/workflows/website-publish.yml
index 9b3a87c..258cc0e 100644
--- a/website/scripts/publish_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,34 +17,24 @@
 # under the License.
 #
 
-set -e
+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/build-site.sh
+          website/scripts/publish-site.sh
+        with:
+          token: ${{ secrets.GITHUB_TOKEN }}
+          sourceRunId: ${{ github.event.workflow_run.id }}
 
-ROOT_DIR=$(git rev-parse --show-toplevel)
-WORK_DIR=${ROOT_DIR}/build
-ME=`basename $0`
-echo "Basename $ME"
-
-# ORIGIN_REPO=$(git remote show origin | grep 'Push  URL' | awk -F// '{print 
$NF}')
-ORIGIN_REPO="https://github.com/apache/incubator-pinot-site";
-echo "ORIGIN_REPO: $ORIGIN_REPO"
-
-SITE_TMP=/tmp/pinot-site 
-(
-
-  cd $ROOT_DIR
-  rm -rf $SITE_TMP
-  mkdir $SITE_TMP
-  cd $SITE_TMP
-
-  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
-
-  # 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
-)
\ No newline at end of file
diff --git a/website/scripts/publish_site.sh b/website/scripts/publish_site.sh
index 9b3a87c..c155db6 100644
--- a/website/scripts/publish_site.sh
+++ b/website/scripts/publish_site.sh
@@ -40,12 +40,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

Reply via email to