You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by fr...@apache.org on 2022/03/31 04:13:25 UTC
[calcite-avatica-go] branch master updated: [CALCITE-3129] Automate website builds
This is an automated email from the ASF dual-hosted git repository.
francischuang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/calcite-avatica-go.git
The following commit(s) were added to refs/heads/master by this push:
new b6d519c [CALCITE-3129] Automate website builds
b6d519c is described below
commit b6d519c4e7dc8f63401650ea129933aeb9cd7dda
Author: Francis Chuang <fr...@apache.org>
AuthorDate: Thu Mar 31 10:19:18 2022 +1100
[CALCITE-3129] Automate website builds
---
.github/workflows/publish-website.yml | 48 +++++++++++++++++++++++++++++++++++
site/README.md | 6 ++---
2 files changed, 50 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/publish-website.yml b/.github/workflows/publish-website.yml
new file mode 100644
index 0000000..b6d0855
--- /dev/null
+++ b/.github/workflows/publish-website.yml
@@ -0,0 +1,48 @@
+name: Publish website on release
+
+on:
+ push:
+ tags:
+ - v[0-9]+.[0-9]+.[0-9]+ # Trigger if a tag matching vX.Y.Z is pushed
+ branches:
+ - master # or if there is a push to master
+ paths:
+ - 'site/**' # and files in the site/ folder are changed
+ - '!site/_docs/go_client_reference.md' # except for site/_docs/go_client_reference.md
+
+jobs:
+ publish-website:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ repository: apache/calcite-avatica
+ path: calcite-avatica
+ fetch-depth: 0
+ token: ${{ secrets.CALCITE_WEBSITE_BUILD }}
+ - name: Reset avatica documentation partially to last release, except for the excluded files
+ working-directory: calcite-avatica/site
+ run: |
+ LATEST_TAG=$(git describe --exclude "*-rc*" --tags --abbrev=0)
+ git checkout tags/$LATEST_TAG $(find _docs -type f \( ! -iname "docker_images.md" ! -iname "history.md" ! -iname "howto.md" ! -iname "index.md" \))
+ - name: Build site
+ working-directory: calcite-avatica/site
+ run: |
+ docker-compose run -e JEKYLL_UID=$(id -u) -e JEKYLL_GID=$(id -g) build-site
+ - uses: actions/checkout@v3
+ with:
+ repository: apache/calcite-site
+ path: calcite-site
+ token: ${{ secrets.CALCITE_WEBSITE_BUILD }}
+ - name: Publish site
+ working-directory: calcite-site
+ run: |
+ git config user.email ${{ github.actor }}@users.noreply.github.com
+ git config user.name ${{ github.actor }}
+ rm -rf avatica/
+ mv ../calcite-avatica/site/target/avatica/ .
+ git reset -- avatica/javadocAggregate/ # Restore the avatica javadoc
+ git checkout -- avatica/javadocAggregate/
+ git add .
+ git commit -m "Website deployed from calcite-avatica-go@$GITHUB_SHA"
+ git push origin master
diff --git a/site/README.md b/site/README.md
index a9dcfee..d6b8593 100644
--- a/site/README.md
+++ b/site/README.md
@@ -24,7 +24,5 @@ This directory contains the code for the web pages documenting the Calcite Avati
It is symlinked and built by the [Avatica web site](https://calcite.apache.org/avatica),
a sub-directory of the [Apache Calcite web site](https://calcite.apache.org).
-## Pushing to site
-
-The web pages are pulled by the Apache Calcite Avatica project when building the Avatica site and pushes should be done
-from the Apache Calcite Avatica repository.
\ No newline at end of file
+The web pages are pulled by the Apache Calcite Avatica project when building the Avatica site and is automatically
+built and published following the process outlined in the [Calcite repository](https://github.com/apache/calcite/blob/master/site/README.md).
\ No newline at end of file