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
commit 00df39b540bcb009a6b80de37fe16dfcc4d02a07 Author: Francis Chuang <[email protected]> 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..8950863 --- /dev/null +++ b/.github/workflows/publish-website.yml @@ -0,0 +1,48 @@ +name: Publish website + +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
