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/20 14:01:26 UTC

[avro] branch avro-3686-asf.yaml-docs updated: AVRO-3686: Automate the creation of the target site branch

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


The following commit(s) were added to refs/heads/avro-3686-asf.yaml-docs by this push:
     new 18e005b4e AVRO-3686: Automate the creation of the target site branch
18e005b4e is described below

commit 18e005b4e3eded2ca8dfd6cc0f3ae3ec228a882e
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
AuthorDate: Tue Dec 20 15:58:54 2022 +0200

    AVRO-3686: Automate the creation of the target site branch
    
    Signed-off-by: Martin Tzvetanov Grigorov <mg...@apache.org>
---
 .github/workflows/docs.yaml | 34 +++++++++++++++++++---------------
 1 file changed, 19 insertions(+), 15 deletions(-)

diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml
index 9b36c6cef..c757574c7 100644
--- a/.github/workflows/docs.yaml
+++ b/.github/workflows/docs.yaml
@@ -33,10 +33,17 @@ jobs:
   build-docs:
     runs-on: ubuntu-20.04
     steps:
+      - name: Checkout docs sources
+        uses: actions/checkout@v3
+        with:
+          submodules: recursive
+
       - name: Set target branch
         id: variables
         run: |
           set -x
+          VERSION=$(cat share/VERSION.txt)
+          echo "version=$VERSION" >> $GITHUB_OUTPUT
           if test '${{ github.ref }}' = 'refs/heads/avro-3686-asf.yaml-docs'; then
             echo "target-branch=site-staging" >> $GITHUB_OUTPUT
             echo "baseUrl=/next" >> $GITHUB_OUTPUT
@@ -48,17 +55,12 @@ jobs:
             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.variables.outputs.target-branch }}
-          path: docs-target
+#      - name: Checkout docs target branch
+#        uses: actions/checkout@v3
+#        with:
+#          fetch-depth: 0
+#          ref: ${{ steps.variables.outputs.target-branch }}
+#          path: docs-target
 
       - uses: actions/setup-node@v3
         with:
@@ -87,10 +89,12 @@ jobs:
       - name: Copy & push the generated HTML
         run: |
           set -x
-          cd docs-target
-          # delete anything but: 1) '.'; 2) '..'; 3) .git/
+          cp .asf.yaml website/
+          git checkout -B ${{ steps.variables.outputs.target-branch }}
+#          cd docs-target
+          # delete anything but: 1) '.'; 2) '..'; 3) .git/;
           find ./ | grep -vE "^./$|^../$|^./.git" | xargs rm -rf
-          cp ../.asf.yaml .
+#          cp ../.asf.yaml .
           cp -r ../website/* .
           # TODO copy the C/C++/C# docs
           if [ "$(git status --porcelain)" != "" ]; then
@@ -98,5 +102,5 @@ jobs:
             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
+            git push --set-upstream origin ${{ steps.variables.outputs.target-branch }} || git push --force
           fi