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

mgrigorov pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/avro.git


The following commit(s) were added to refs/heads/main by this push:
     new b3743f732 [NO-JIRA][Website] Wipe out the old contents of asf-site 
branch (#3110)
b3743f732 is described below

commit b3743f73289bb935b277e80e4cb9f508900598f4
Author: Martin Grigorov <[email protected]>
AuthorDate: Thu Aug 22 14:44:50 2024 +0300

    [NO-JIRA][Website] Wipe out the old contents of asf-site branch (#3110)
    
    * [NO-JIRA][Website] Wipe out the old contents of asf-site branch
    
    and copy over only the newly generated .html files
    
    Also create a simple .asf.yaml file with `publish`
    
    Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
    
    Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
    
    * Update the commit message to link to its trigger
    
    Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
    
    * Improve the workflow description comment
    
    Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
    
    * Use `hugo --destination ...` instead of moving folders later
    
    Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
    
    ---------
    
    Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
---
 .github/workflows/deploy-docs.yml | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/deploy-docs.yml 
b/.github/workflows/deploy-docs.yml
index 925244b40..0ef81b3f1 100644
--- a/.github/workflows/deploy-docs.yml
+++ b/.github/workflows/deploy-docs.yml
@@ -16,8 +16,8 @@
 # to commit it to your repository.
 
 
-# Sample workflow for building and deploying a Hugo site to GitHub Pages
-name: Deploy Hugo site to Pages
+# A Github Actions workflow that builds and copies the website to asf-site 
branch
+name: Deploy website
 
 on:
   # Runs on pushes targeting the default branch
@@ -64,16 +64,26 @@ jobs:
           hugo \
             --gc \
             --minify \
-            --baseURL "https://avro.apache.org/";
+            --destination ${{ runner.temp }}/website \
+            --baseURL "/"
       - name: Commit new site
         run: |
           set -ex
-          mv doc/public docs/
+          rsync \
+            -a \
+            --delete \
+            --exclude '/.git/' \
+            ${{ runner.temp }}/website/ \
+            ./
+          echo "publish:
+                  whoami: asf-site
+                " > .asf.yaml
+          touch .nojekyll
           git config --global user.email "[email protected]"
           git config --global user.name "Github Actions"
           git checkout --orphan asf-site-staging
-          git add .
-          git commit -m "Update docs"
+          git add --all
+          git commit -m "Publish built website triggered by ${{ github.sha }}"
           git checkout asf-site
           git reset --hard asf-site-staging
           git push origin asf-site --force

Reply via email to