This is an automated email from the ASF dual-hosted git repository.

jiayu pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/sedona-db.git


The following commit(s) were added to refs/heads/main by this push:
     new 1ccdcca  Update the github action to leverage mike for versioned doc 
(#88)
1ccdcca is described below

commit 1ccdccad0440147ea736fa7c959bde0c354ff567
Author: Jia Yu <[email protected]>
AuthorDate: Tue Sep 16 00:18:05 2025 -0700

    Update the github action to leverage mike for versioned doc (#88)
---
 .github/workflows/packaging.yml | 55 +++++++++++------------------------------
 .gitignore                      |  1 +
 2 files changed, 16 insertions(+), 40 deletions(-)

diff --git a/.github/workflows/packaging.yml b/.github/workflows/packaging.yml
index 2957a9b..7101606 100644
--- a/.github/workflows/packaging.yml
+++ b/.github/workflows/packaging.yml
@@ -21,6 +21,7 @@ on:
   push:
     branches:
       - main
+      - 'branch-*'
     tags:
         - 'apache-sedona-db-*-rc*'
   pull_request:
@@ -72,10 +73,12 @@ jobs:
           path: |
             apache-sedona-db-${{ env.VERSION }}.tar.gz
 
-  docs:
+  docs-and-deploy:
     runs-on: ubuntu-latest
     env:
       CARGO_INCREMENTAL: 0
+    permissions:
+      contents: write
 
     steps:
       - uses: actions/checkout@v4
@@ -126,53 +129,25 @@ jobs:
           path: |
             docs.tgz
 
-  update-asf-site:
-    runs-on: ubuntu-latest
-    needs:
-      - docs
-    permissions:
-      contents: write
-
-    steps:
-      - uses: actions/download-artifact@v4
-        with:
-          name: docs
-
-      - name: Clone asf-site branch
-        uses: actions/checkout@v4
-        with:
-          ref: asf-site
-          path: pages-clone
-
-      - name: Update development documentation
-        env:
-          DOC_TAG: "dev-snapshot-main"
-
+      - name: Deploy the doc to the website branch
+        if: ${{ github.event_name != 'pull_request' && github.repository == 
'apache/sedona-db' }}
         run: |
           git config --global user.email "[email protected]"
           git config --global user.name "GitHub Actions"
-
-          cd pages-clone
-          if [ -d "$DOC_TAG" ]; then
-            git rm -rf "$DOC_TAG"
+          git fetch origin asf-site --depth=1
+
+          if [[ "${GITHUB_REF##*/}" == "main" ]]; then
+            mike deploy latest-snapshot -b asf-site -p
+          elif [[ "${GITHUB_REF##*/}" =~ ^branch-[0-9]+\.[0-9]+\.[0-9]+$ ]]; 
then
+            version="${GITHUB_REF##*/branch-}"
+            mike deploy --update-aliases "$version" latest -b asf-site -p
+            mike set-default latest -b asf-site -p
           fi
 
-          tar -xf ../docs.tgz
-          mv sedona-db-docs "$DOC_TAG"
-
-          git add *
-          git commit --allow-empty -m"update documentation for tag $DOC_TAG"
-
-      - name: Push development documentation to asf-site
-        if: success() && github.repository == 'apache/sedona-db' && github.ref 
== 'refs/heads/main'
-        run: |
-          cd pages-clone
-          git push
-
   create-release:
     runs-on: ubuntu-latest
     needs:
-      - docs
+      - docs-and-deploy
       - source
     permissions:
       contents: write
diff --git a/.gitignore b/.gitignore
index 3ef7d21..3d88842 100644
--- a/.gitignore
+++ b/.gitignore
@@ -46,3 +46,4 @@ __pycache__
 
 # R-related files
 .Rproj.user
+*

Reply via email to