From 21bdcb450e66a5f416eed554de0261c0ab4ad803 Mon Sep 17 00:00:00 2001
From: Jack Zhuang <50353452+hotlong@users.noreply.github.com>
Date: Thu, 25 Apr 2024 15:37:55 +0800
Subject: [PATCH] deploy to cn
---
.github/workflows/deploy-cn.yml | 43 +++++++++++++++++++++++++++++++++
README.md | 14 ++++++++++-
docusaurus.config.js | 36 +++++++++++++--------------
package.json | 1 +
4 files changed, 75 insertions(+), 19 deletions(-)
create mode 100644 .github/workflows/deploy-cn.yml
diff --git a/.github/workflows/deploy-cn.yml b/.github/workflows/deploy-cn.yml
new file mode 100644
index 0000000..e72ab00
--- /dev/null
+++ b/.github/workflows/deploy-cn.yml
@@ -0,0 +1,43 @@
+name: Deploy steedos.cn
+
+on:
+ push:
+ tags: # Deploy tag (e.g. v1.0) to production
+ - 'v**'
+ branches:
+ - 'beta'
+
+jobs:
+ deploy:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v2
+
+ - name: Install dependencies
+ run: yarn install
+
+ - name: Build Docusaurus site
+ run: yarn build:cn
+
+ - name: Configure AWS credentials
+ uses: aws-actions/configure-aws-credentials@v1
+ with:
+ aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
+ aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
+ aws-region: cn-northwest-1
+
+ - name: Deploy to S3
+ uses: jakejarvis/s3-sync-action@master
+ with:
+ args: --acl public-read --follow-symlinks --delete
+ env:
+ AWS_S3_BUCKET: docs-steedos-cn
+ AWS_S3_REGION: cn-northwest-1
+ SOURCE_DIR: ./build/
+
+ - name: Invalidate CloudFront distribution
+ run: |
+ aws cloudfront create-invalidation --distribution-id E2XLZVP0KTH5PI --paths "/*"
+
+
\ No newline at end of file
diff --git a/README.md b/README.md
index 02736da..cf4276f 100644
--- a/README.md
+++ b/README.md
@@ -43,10 +43,22 @@ This command generates static content into the `build` directory and can be serv
## Release
-### 发布正式版
+### 发布多语言版
在main分支创建tag,发布正式版到 https://docs.steedos.com
+```
+yarn build
+```
+
+### 发布中文版
+
+在main分支创建tag,发布正式版到 https://docs.steedos.cn
+
+```
+yarn build --locale zh-CN
+```
+
### 发布测试版
更新beta分支,发布测试版到 https://docs-beta.steedos.com
diff --git a/docusaurus.config.js b/docusaurus.config.js
index c5a34df..b99fcee 100644
--- a/docusaurus.config.js
+++ b/docusaurus.config.js
@@ -94,14 +94,14 @@ const config = {
disableSwitch: true,
respectPrefersColorScheme: false,
},
- announcementBar: {
- id: 'support_us',
- content:
- '⭐️ If you like Steedos, give a star on GitHub.',
- backgroundColor: '#4D72DA',
- textColor: '#ffffff',
- isCloseable: true,
- },
+ // announcementBar: {
+ // id: 'support_us',
+ // content:
+ // '⭐️ If you like Steedos, give a star on GitHub.',
+ // backgroundColor: '#4D72DA',
+ // textColor: '#ffffff',
+ // isCloseable: true,
+ // },
navbar: {
title: 'Steedos',
logo: {
@@ -118,20 +118,20 @@ const config = {
{
type: 'docSidebar',
position: 'left',
- sidebarId: 'platform',
- label: 'Docs',
+ sidebarId: 'solutions',
+ label: 'Solutions',
},
{
type: 'docSidebar',
position: 'left',
- sidebarId: 'developer',
- label: 'Developer',
+ sidebarId: 'platform',
+ label: 'Docs',
},
{
type: 'docSidebar',
position: 'left',
- sidebarId: 'solutions',
- label: 'Solutions',
+ sidebarId: 'developer',
+ label: 'Developer',
},
{
type: 'search',
@@ -141,10 +141,10 @@ const config = {
// type: 'docsVersionDropdown',
// position: 'right',
// },
- {
- type: 'localeDropdown',
- position: 'right',
- },
+ // {
+ // type: 'localeDropdown',
+ // position: 'right',
+ // },
{
href: 'https://github.com/steedos/steedos-platform',
position: 'right',
diff --git a/package.json b/package.json
index 77fdc22..30376d5 100644
--- a/package.json
+++ b/package.json
@@ -7,6 +7,7 @@
"start": "docusaurus start",
"start:cn": "docusaurus start --locale zh-CN",
"build": "docusaurus build",
+ "build:cn": "docusaurus build --locale zh-CN",
"build:openapi": "redocly build-docs openapi/records.yaml -o static/openapi/records/index.html",
"build:openapi:cn": "redocly build-docs openapi/zh-CN/records.yaml -o static/zh-CN/openapi/records/index.html",
"swizzle": "docusaurus swizzle",