You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by ti...@apache.org on 2024/05/01 17:11:59 UTC

(opendal) 01/02: build: staging website

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

tison pushed a commit to branch staging
in repository https://gitbox.apache.org/repos/asf/opendal.git

commit 1ff04f8c4564d71931e10d98ccd76f5a8409cfcb
Author: tison <wa...@gmail.com>
AuthorDate: Thu May 2 00:43:44 2024 +0800

    build: staging website
    
    Signed-off-by: tison <wa...@gmail.com>
---
 .asf.yaml                  |  4 ++++
 .github/workflows/docs.yml | 26 ++++++++++++++++++++++++--
 2 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/.asf.yaml b/.asf.yaml
index caab89d8ff..b943bdea3d 100644
--- a/.asf.yaml
+++ b/.asf.yaml
@@ -44,5 +44,9 @@ notifications:
   pullrequests: commits@opendal.apache.org
   discussions: commits@opendal.apache.org
 
+staging:
+  profile: ~
+  whoami:  asf-staging
+
 publish:
   whoami: gh-pages
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index e0c0a91834..f7a431146a 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -21,6 +21,8 @@ on:
   push:
     branches:
       - main
+    tags:
+      - 'v*'
   pull_request:
     branches:
       - main
@@ -467,6 +469,26 @@ jobs:
       - name: Clear build
         run: rm -rf ./website/build
 
+      - name: Build for staging version
+        working-directory: website
+        run: pnpm build
+        env:
+            OPENDAL_WEBSITE_STAGING: true
+
+      - name: Copy asf file
+        run: cp .asf.yaml ./website/build/.asf.yaml
+
+      - name: Deploy to asf-staging
+        uses: peaceiris/actions-gh-pages@v3.9.2
+        if: github.event_name == 'push' && github.ref_name == 'main'
+        with:
+          github_token: ${{ secrets.GITHUB_TOKEN }}
+          publish_dir: website/build
+          publish_branch: asf-staging
+
+      - name: Clear build
+        run: rm -rf ./website/build
+
       - name: Build for nightlies with tagged version
         working-directory: website
         run: pnpm build
@@ -477,7 +499,7 @@ jobs:
 
       - name: Deploy to nightlies for tagged version
         uses: burnett01/rsync-deployments@5.2
-        if: "startsWith(github.ref, 'refs/tags/')"
+        if: ${{ startsWith(github.ref, 'refs/tags/') && !contains(github.ref, 'rc') }}
         with:
           switches: -avzr
           path: website/build/
@@ -498,7 +520,7 @@ jobs:
 
       - name: Deploy to nightlies for stable version
         uses: burnett01/rsync-deployments@5.2
-        if: "startsWith(github.ref, 'refs/tags/')"
+        if: ${{ startsWith(github.ref, 'refs/tags/') && !contains(github.ref, 'rc') }}
         with:
           switches: -avzr --delete
           path: website/build/