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

xuba pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/amoro.git


The following commit(s) were added to refs/heads/master by this push:
     new aa4f95160 [Hotfix] Fix the deploy site GitHub workflow (#4020)
aa4f95160 is described below

commit aa4f9516020fba409523e95a54a5796aff63b63e
Author: ZhouJinsong <[email protected]>
AuthorDate: Tue Dec 23 10:09:06 2025 +0800

    [Hotfix] Fix the deploy site GitHub workflow (#4020)
    
    * Fix deploy site GitHub workflow
    
    * Add publish information in the .asf.yaml
---
 .asf.yaml                         |   3 ++
 .github/workflows/site-deploy.yml | 102 +++++++++++++++++++++++++++++---------
 2 files changed, 81 insertions(+), 24 deletions(-)

diff --git a/.asf.yaml b/.asf.yaml
index 622a0be37..bcacbb58d 100644
--- a/.asf.yaml
+++ b/.asf.yaml
@@ -45,3 +45,6 @@ github:
 notifications:
   commits: [email protected]
   discussions: [email protected]
+
+publish:
+  whoami: asf-site
diff --git a/.github/workflows/site-deploy.yml 
b/.github/workflows/site-deploy.yml
index 06ba2afdf..d1eb5fe59 100644
--- a/.github/workflows/site-deploy.yml
+++ b/.github/workflows/site-deploy.yml
@@ -19,7 +19,13 @@ jobs:
     steps:
       - uses: actions/checkout@v3
         with:
-          fetch-depth: 0
+          fetch-depth: 1
+
+      - uses: actions/checkout@v3
+        with:
+          ref: asf-site
+          fetch-depth: 1
+          path: asf-site
 
       - name: Setup Hugo
         uses: peaceiris/actions-hugo@v2
@@ -28,16 +34,26 @@ jobs:
           extended: true
 
       - name: Build
-        run: cd site/amoro-site && hugo -b https://amoro.apache.org/ -d 
../../output
+        run: |
+          echo "Building amoro site pages"
+          cd site/amoro-site && hugo -b https://amoro.apache.org/ -d 
../../output
+          cd ../../
+          echo "Copying the result to the asf-site location"
+          cp -rf output/* asf-site/output/
 
       - name: Deploy
-        uses: peaceiris/actions-gh-pages@v3
-        with:
-          github_token: ${{ secrets.GITHUB_TOKEN }}
-          publish_dir: ./output
-          publish_branch: asf-site
-          destination_dir: ./output
-          keep_files: true
+        working-directory: asf-site
+        run: |
+          echo "Running git config"
+          git config user.name "GitHub Actions"
+          git config user.email "[email protected]"
+          echo "Running git add -A"
+          git add -A .
+          echo "Running git commit"
+          if git commit -m "Regenerated Amoro site page based on ${GITHUB_SHA} 
commit"
+          then
+            git push origin asf-site
+          fi
 
   deploy-latest-docs-page:
     needs: deploy-site-page
@@ -45,6 +61,14 @@ jobs:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v3
+        with:
+          fetch-depth: 1
+
+      - uses: actions/checkout@v3
+        with:
+          ref: asf-site
+          fetch-depth: 1
+          path: asf-site
 
       - name: Setup Hugo
         uses: peaceiris/actions-hugo@v2
@@ -53,16 +77,27 @@ jobs:
           extended: true
 
       - name: Build
-        run: cd site/amoro-docs && hugo -b 
https://amoro.apache.org/docs/latest -d ../../output/docs/latest
+        run: |
+          echo "Building latest docs page"
+          cd site/amoro-docs && hugo -b https://amoro.apache.org/docs/latest 
-d ../../output/docs/latest
+          cd ../../
+          echo "Copying the result to the asf-site location"
+          cp -rf output/docs/latest/* asf-site/output/docs/latest
+          
 
       - name: Deploy
-        uses: peaceiris/actions-gh-pages@v3
-        with:
-          github_token: ${{ secrets.GITHUB_TOKEN }}
-          publish_dir: ./output/docs/latest
-          publish_branch: asf-site
-          destination_dir: ./output/docs/latest
-          keep_files: true
+        working-directory: asf-site
+        run: |
+          echo "Running git config"
+          git config user.name "GitHub Actions"
+          git config user.email "[email protected]"
+          echo "Running git add -A"
+          git add -A .
+          echo "Running git commit"
+          if git commit -m "Regenerated Amoro latest docs page based on 
${GITHUB_SHA} commit"
+          then
+            git push origin asf-site
+          fi
 
   deploy-versioned-docs-page:
     if: (github.ref != 'refs/heads/master' && (startsWith(github.ref, 
'refs/heads/') || startsWith(github.ref, 'refs/tags/')))
@@ -70,6 +105,14 @@ jobs:
     continue-on-error: true
     steps:
       - uses: actions/checkout@v3
+        with:
+          fetch-depth: 1
+
+      - uses: actions/checkout@v3
+        with:
+          ref: asf-site
+          fetch-depth: 1
+          path: asf-site
 
       - name: Set output
         id: vars
@@ -93,12 +136,23 @@ jobs:
           extended: true
 
       - name: Build
-        run: cd site/amoro-docs && hugo -b https://amoro.apache.org/docs/${{ 
steps.vars.outputs.branch_name }}/ -d ../../output/docs/${{ 
steps.vars.outputs.branch_name }}
+        run: |
+          echo "Building versioned docs page"
+          cd site/amoro-docs && hugo -b https://amoro.apache.org/docs/${{ 
steps.vars.outputs.branch_name }}/ -d ../../output/docs/${{ 
steps.vars.outputs.branch_name }}
+          cd ../../
+          echo "Copying the result to the asf-site location"
+          cp -rf output/docs/${{ steps.vars.outputs.branch_name }}/* 
asf-site/output/docs/${{ steps.vars.outputs.branch_name }}
 
       - name: Deploy
-        uses: peaceiris/actions-gh-pages@v3
-        with:
-          github_token: ${{ secrets.GITHUB_TOKEN }}
-          publish_dir: ./output/docs/${{ steps.vars.outputs.branch_name }}
-          publish_branch: asf-site
-          destination_dir: ./output/docs/${{ steps.vars.outputs.branch_name }}
+        working-directory: asf-site
+        run: |
+          echo "Running git config"
+          git config user.name "GitHub Actions"
+          git config user.email "[email protected]"
+          echo "Running git add -A"
+          git add -A .
+          echo "Running git commit"
+          if git commit -m "Regenerated Amoro versioned docs page based on 
${GITHUB_SHA} commit"
+          then
+            git push origin asf-site
+          fi
\ No newline at end of file

Reply via email to