Site: Remove documentation for live-reloading during development as i… #15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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. | |
# | |
name: Publish website | |
on: | |
push: | |
tags: | |
- v[0-9]+.[0-9]+.[0-9]+ # Trigger if a tag matching vX.Y.Z is pushed | |
branches: | |
- main # or if there is a push to main | |
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@v4 | |
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@v4 | |
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 . | |
if ! git diff-index --quiet HEAD; then | |
git commit -m "Website deployed from calcite-avatica-go@$GITHUB_SHA" | |
git push origin main | |
fi |