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

wwei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-yunikorn-site.git


The following commit(s) were added to refs/heads/master by this push:
     new cd5e7ff  [YUNIKORN-215] build yunikorn web site automatically.
cd5e7ff is described below

commit cd5e7ff587b6d7e2b73b235276c646cdcf6cc706
Author: Weiwei Yang <[email protected]>
AuthorDate: Thu Jul 16 01:52:01 2020 -0700

    [YUNIKORN-215] build yunikorn web site automatically.
---
 .github/workflow/auto-publish.yml | 51 +++++++++++++++++++++++++++++++++++++++
 Dockerfile                        |  5 ++--
 2 files changed, 53 insertions(+), 3 deletions(-)

diff --git a/.github/workflow/auto-publish.yml 
b/.github/workflow/auto-publish.yml
new file mode 100644
index 0000000..f37d62d
--- /dev/null
+++ b/.github/workflow/auto-publish.yml
@@ -0,0 +1,51 @@
+name: yunikorn-site auto-publish
+
+on:
+  pull_request:
+    branches:
+      - master
+
+jobs:
+  build:
+    runs-on: ubuntu-latest
+    steps:
+      - name: "Check out latest code on master branch"
+        uses: actions/checkout@v2
+        with:
+          path: './yunikorn-master'
+      - name: "Build and run website locally"
+        working-directory: './yunikorn-master'
+        run: |
+          docker build -t yunikorn/yunikorn-website:1.0.0 .
+          docker run -d -p 4000:4000 -v $PWD/yunikorn-site:/yunikorn-site 
yunikorn/yunikorn-website:1.0.0
+      - name: "Wait until the local website server populates static pages"
+        working-directory: './yunikorn-master'
+        run: |
+          bash -c 'while true; do curl -Is http://localhost:4000 | head -n 1 | 
grep "OK"; [ $? -eq 0 ] && break; sleep 3; done'
+          echo "backup generated files"
+          mkdir /tmp/site-backup
+          cp -R yunikorn-site/* /tmp/site-backup
+          ls -al /tmp/site-backup/*
+        shell: bash
+        timeout-minutes: 5
+      - name: "Checkout asf-site branch"
+        uses: actions/checkout@v2
+        with:
+          path: './yunikorn-asf-site'
+          ref: 'asf-site'
+      - name: "Commit changes"
+        working-directory: './yunikorn-asf-site'
+        run: |
+          echo "wipe out the content (except files starting with dot)"
+          rm -rf ./*
+          cp -R /tmp/site-backup/* .
+          git config --local user.email "[email protected]"
+          git config --local user.name "yunikorn-bot"
+          git add .
+          git commit -m "Auto refresh web-site content" -a
+      - name: "Push changes"
+        uses: ad-m/github-push-action@master
+        with:
+          branch: 'asf-site'
+          directory: './yunikorn-asf-site'
+          github_token: ${{ secrets.GITHUB_TOKEN }}
\ No newline at end of file
diff --git a/Dockerfile b/Dockerfile
index 6f838db..77707af 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -14,7 +14,6 @@
 # limitations under the License.
 
 FROM node:12.18.0
-
 ADD . /incubator-yunikorn-site
-
-WORKDIR /incubator-yunikorn-site
\ No newline at end of file
+WORKDIR /incubator-yunikorn-site
+ENTRYPOINT bundle update && bundle exec jekyll serve --destination 
/yunikorn-site/ --watch --host=0.0.0.0
\ No newline at end of file

Reply via email to