[WAYANG-27] auto deploy on the wayang site
diff --git a/.travis.yml b/.travis.yml
index 419abde..e5868b7 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -69,4 +69,7 @@
   - bin/change-scala-version.sh 2.11.8 && mvn clean install -Pdistro "${mvn_opts[@]}" &> result.log
   - cat /home/travis/build/apache/incubator-wayang/target/rat.txt || echo "file doesn't exist"
   - tail -n 2000 result.log
-  -
+
+after_success:
+  # generate the documentation and create a update of the documentation if something change there
+  - if [ -z $(git diff HEAD --name-only | grep "wayang-docs") ] ; then mvn gem:exec@generate-documentation gem:exec@generate-documentation-as-latest site:site -pl wayang-docs ; fi
diff --git a/wayang-docs/pom.xml b/wayang-docs/pom.xml
index 8548dca..0430bcf 100644
--- a/wayang-docs/pom.xml
+++ b/wayang-docs/pom.xml
@@ -60,7 +60,18 @@
                         <phase>generate-resources</phase>
                         <configuration>
                             <file>${user.home}/.gem/bin/jekyll</file>
-                            <execArgs>build --trace --source ${project.basedir}/src/main/resources --destination ${project.build.outputDirectory}/../site/website</execArgs>
+                            <execArgs>build --trace --source ${project.basedir}/src/main/resources --destination ${project.build.outputDirectory}/site/website/docs/${project.version}</execArgs>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>generate-documentation-as-latest</id>
+                        <goals>
+                            <goal>exec</goal>
+                        </goals>
+                        <phase>generate-resources</phase>
+                        <configuration>
+                            <file>${user.home}/.gem/bin/jekyll</file>
+                            <execArgs>build --trace --source ${project.basedir}/src/main/resources --destination ${project.build.outputDirectory}/site/website/docs/latest</execArgs>
                         </configuration>
                     </execution>
                     <execution>
@@ -93,12 +104,11 @@
                     <noJekyll>true</noJekyll>
                     <repositoryOwner>apache</repositoryOwner>
                     <repositoryName>incubator-wayang-website</repositoryName>
-                    <branch>refs/heads/asf-docs</branch>
+                    <branch>refs/heads/asf-site</branch>
                     <message>Creating site for ${project.version}</message>
-                    <outputDirectory>${project.build.outputDirectory}/../site/website</outputDirectory>
+                    <outputDirectory>${project.build.outputDirectory}/site/website</outputDirectory>
                     <includes>
                         <include>**/*</include>
-                        <include>**/.asf.yaml</include>
                     </includes>
                     <merge>true</merge>
                 </configuration>
diff --git a/wayang-docs/src/main/resources/.asf.yaml b/wayang-docs/src/main/resources/.asf.yaml
deleted file mode 100644
index 811c7a4..0000000
--- a/wayang-docs/src/main/resources/.asf.yaml
+++ /dev/null
@@ -1,45 +0,0 @@
-#
-# 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.
-#
-notifications:
-  commits:      commits@wayang.apache.org
-  issues:       issues@wayang.apache.org
-  pullrequests: dev@wayang.apache.org
-  jira_options: link label worklog comment
-
-publish:
-  whoami:  asf-docs
-
-github:
-  description: "Apache Wayang is an Cross-Platform processing system"
-  homepage: https://wayang.apache.org/docs
-  features:
-    # Disable wiki for documentation
-    wiki: false
-    # Disable issue management
-    issues: false
-    # Disable projects for project management boards
-    projects: false
-  enabled_merge_buttons:
-    # enable squash button:
-    squash:  true
-    # enable merge button:
-    merge:   true
-    # disable rebase button:
-    rebase:  false
-
-  ghp_branch: asf-docs
-  ghp_path: /
diff --git a/wayang-docs/src/main/resources/Gemfile.lock b/wayang-docs/src/main/resources/Gemfile.lock
index f27db32..433ff60 100644
--- a/wayang-docs/src/main/resources/Gemfile.lock
+++ b/wayang-docs/src/main/resources/Gemfile.lock
@@ -37,6 +37,8 @@
     jekyll-asciidoc (2.1.1)
       asciidoctor (>= 1.5.0)
       jekyll (>= 2.3.0)
+    jekyll-menus (0.6.1)
+      jekyll (>= 3.6, < 5.0)
     jekyll-sass-converter (2.1.0)
       sassc (> 2.0.1, < 3.0)
     jekyll-watch (2.2.1)
@@ -73,6 +75,7 @@
   coderay (~> 1.1.0)
   jekyll (~> 4.2)
   jekyll-asciidoc (~> 2.1.1)
+  jekyll-menus
 
 BUNDLED WITH
    2.2.14
diff --git a/wayang-docs/src/main/resources/script/cibuild b/wayang-docs/src/main/resources/script/cibuild
deleted file mode 100644
index fabac01..0000000
--- a/wayang-docs/src/main/resources/script/cibuild
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/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 # halt script on error
-
-URL="https://wayang.apache.org"
-BASE_URL="/docs"
-BRANCH_PAGE=asf-site
-
-export JEKYLL_ENV="production"
-
-echo "url: \"${URL}\"" > _config.yml.tmp
-echo "baseurl: \"${BASE_URL}\"" >> _config.yml.tmp
-cat _config.yml | grep -v "url:" >> _config.yml.tmp
-mv _config.yml.tmp _config.yml
-
-bundle exec jekyll build
-if [ "${VALIDATE}" != "" ]; then
-  bundle exec htmlproofer ./_site
-else
-  echo "it will not validate the site"
-fi
-
-mkdir -p ../tmp
-mv ./_site/* ../tmp
-cp DISCLAIMER ../tmp
-cp LICENSE.TXT ../tmp
-cp NOTICE.TXT ../tmp
-
-git checkout --orphan ${BRANCH_PAGE}
-rm -rf ./*
-
-mv ../tmp/* ./
-
-git add -A
-git status
-git commit -m "Lastest site built on successful travis build $TRAVIS_BUILD_NUMBER auto-pushed to github"
-git remote set-url origin https://${USER}:${TOKEN}@github.com/${TRAVIS_REPO_SLUG}
-git push origin --delete ${BRANCH_PAGE}
-git push origin ${BRANCH_PAGE}:${BRANCH_PAGE}