You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by mg...@apache.org on 2022/12/19 22:08:39 UTC
[avro] 01/02: AVRO-3686: [Site] Add GHA workflow that builds the site
This is an automated email from the ASF dual-hosted git repository.
mgrigorov pushed a commit to branch avro-3686-asf.yaml-docs
in repository https://gitbox.apache.org/repos/asf/avro.git
commit 0b8e92591e0eba342f9bfe7f2340681e846d7be2
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
AuthorDate: Tue Dec 20 00:06:33 2022 +0200
AVRO-3686: [Site] Add GHA workflow that builds the site
Signed-off-by: Martin Tzvetanov Grigorov <mg...@apache.org>
---
.asf.yaml | 7 ++++
.github/workflows/docs.yaml | 85 +++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 92 insertions(+)
diff --git a/.asf.yaml b/.asf.yaml
index c5838695f..26da33188 100644
--- a/.asf.yaml
+++ b/.asf.yaml
@@ -48,3 +48,10 @@ notifications:
# Send individual PR comments/reviews to issues@
pullrequests_comment: issues@avro.apache.org
jira_options: link label worklog
+
+staging:
+# whoami: site-staging
+ whoami: avro-3686-asf.yaml-docs
+
+publish:
+ whoami: site-production
diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml
new file mode 100644
index 000000000..b751dbdff
--- /dev/null
+++ b/.github/workflows/docs.yaml
@@ -0,0 +1,85 @@
+# 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
+#
+# https://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.
+# For most projects, this workflow file will not need changing; you simply need
+# to commit it to your repository.
+
+name: Deploy ASF site
+
+on:
+ push:
+ branches:
+# - master
+ - "avro-3686-asf.yaml-docs"
+ tags-ignore:
+ - "release-**-rc**"
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ build-docs:
+ runs-on: ubuntu-20.04
+ steps:
+ - name: Set target branch
+ id: target-branch
+ run: |
+ set -x
+ if test '${{ github.ref }}' = 'refs/heads/avro-3686-asf.yaml-docs'; then
+ echo "value=asf-staging" >> $GITHUB_OUTPUT
+ elif test '${{ github.ref_type }}' = 'tag'; then
+ echo "value=asf-site" >> $GITHUB_OUTPUT
+ else
+ echo "Unsupported input: ${{ github.ref }} / ${{ github.ref_type }}"
+ exit 1
+ fi
+ - name: Checkout docs sources
+ uses: actions/checkout@v3
+ with:
+ submodules: recursive
+ - name: Checkout docs target branch
+ uses: actions/checkout@v3
+ with:
+ fetch-depth: 0
+ ref: ${{ steps.target-branch.outputs.value }}
+ path: docs-target
+
+ - name: Setup Hugo
+ uses: peaceiris/actions-hugo@v2
+ with:
+ hugo-version: 0.108.0
+ extended: true
+ - name: Build docs
+ run: |
+ set -x
+ cd doc
+ hugo --minify --destination ../output
+ # TODO build the C/C++/C# docs
+ - name: Copy & push the generated HTML
+ run: |
+ set -x
+ cd docs-target
+ # delete anything but: 1) '.'; 2) '..'; 3) .git/
+ find ./ | grep -vE "^./$|^../$|^./.git" | xargs rm -rf
+ cp ../.asf.yaml .
+ cp -r ../docs/public/* .
+ # TODO copy the C/C++/C# docs
+ if [ "$(git status --porcelain)" != "" ]; then
+ git config user.name "github-actions[bot]"
+ git config user.email "github-actions[bot]@users.noreply.github.com"
+ git add --all
+ git commit -m 'Publish built docs triggered by ${{ github.sha }}'
+ git push || git push --force
+ fi