You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by su...@apache.org on 2023/12/13 14:09:48 UTC
(incubator-opendal) branch relative-deploy created (now 27a3b7fa4)
This is an automated email from the ASF dual-hosted git repository.
suyanhanx pushed a change to branch relative-deploy
in repository https://gitbox.apache.org/repos/asf/incubator-opendal.git
at 27a3b7fa4 docs(website): polish deploy to nightlies
This branch includes the following new commits:
new 27a3b7fa4 docs(website): polish deploy to nightlies
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(incubator-opendal) 01/01: docs(website): polish deploy to nightlies
Posted by su...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
suyanhanx pushed a commit to branch relative-deploy
in repository https://gitbox.apache.org/repos/asf/incubator-opendal.git
commit 27a3b7fa41c59080e729ffb7e55c0925e16aad70
Author: suyanhanx <su...@gmail.com>
AuthorDate: Tue Dec 12 20:40:36 2023 +0800
docs(website): polish deploy to nightlies
Signed-off-by: suyanhanx <su...@gmail.com>
---
.github/workflows/docs.yml | 25 ++++++++++++++++++++++---
website/.yarnrc.yml | 19 -------------------
website/docusaurus.config.js | 18 +++++++++++++++++-
3 files changed, 39 insertions(+), 23 deletions(-)
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index 55a0c6387..7ede74c35 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -383,21 +383,40 @@ jobs:
publish_dir: website/build
publish_branch: gh-pages
+ - name: Clear build
+ run: rm -rf ./website/build
+
+ - name: Build for nightlies with tagged version
+ working-directory: website
+ run: pnpm build
+ env:
+ BASE_URL: opendal/opendal-docs-release-${{ github.ref_name }}
+ SHOW_Announcement_Bar: true
+
- 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/')"
with:
switches: -avzr
path: website/build/*
- remote_path: ${{ secrets.NIGHTLIES_RSYNC_PATH }}/opendal/opendal-docs-release-${{ github.ref_name }}
+ remote_path: ${{ secrets.NIGHTLIES_RSYNC_PATH }}/opendal/opendal-docs-release-0.43.0
remote_host: ${{ secrets.NIGHTLIES_RSYNC_HOST }}
remote_port: ${{ secrets.NIGHTLIES_RSYNC_PORT }}
remote_user: ${{ secrets.NIGHTLIES_RSYNC_USER }}
remote_key: ${{ secrets.NIGHTLIES_RSYNC_KEY }}
+ - name: Clear build
+ run: rm -rf ./website/build
+
+ - name: Build for nightlies with stable version
+ working-directory: website
+ run: pnpm build
+ env:
+ BASE_URL: opendal/opendal-docs-stable
+
- 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/')"
with:
switches: -avzr --delete
path: website/build/*
diff --git a/website/.yarnrc.yml b/website/.yarnrc.yml
deleted file mode 100644
index 74d3bd6c5..000000000
--- a/website/.yarnrc.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-nodeLinker: node-modules
-
diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js
index e12fd3800..75719e240 100644
--- a/website/docusaurus.config.js
+++ b/website/docusaurus.config.js
@@ -24,6 +24,9 @@ const lightCodeTheme = require('prism-react-renderer/themes/github');
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
const repoAddress = 'https://github.com/apache/incubator-opendal';
+const baseUrl = process.env.BASE_URL ? process.env.BASE_URL : '/';
+const showAnnouncementBar = process.env.SHOW_ANNOUNCEMENT_BAR ? process.env.SHOW_ANNOUNCEMENT_BAR : false;
+
/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'Apache OpenDAL',
@@ -228,4 +231,17 @@ const config = {
}),
};
-module.exports = config;
+function generateConfig() {
+ config.baseUrl = baseUrl
+
+ if (showAnnouncementBar) {
+ config.themeConfig.announcementBar = {
+ id: 'announcementBar-0', // Increment on change
+ content: 'You are viewing the documentation of a <strong>historical release</strong>. <a href="https://nightlies.apache.org/opendal/opendal-docs-stable/">View the latest stable release</a>.',
+ }
+ }
+
+ return config
+}
+
+module.exports = generateConfig();