You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by ju...@apache.org on 2021/02/25 15:22:37 UTC

[apisix-website] branch master updated: feat: sync docs & deploy (#205)

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

juzhiyuan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-website.git


The following commit(s) were added to refs/heads/master by this push:
     new 3504d47  feat: sync docs & deploy (#205)
3504d47 is described below

commit 3504d47cb948ed1d881b2252ac9b9a45665d558b
Author: 琚致远 <ju...@apache.org>
AuthorDate: Thu Feb 25 23:22:28 2021 +0800

    feat: sync docs & deploy (#205)
---
 .github/workflows/deploy.yml                       |  9 ++++++-
 .github/workflows/updateDocs.yaml                  | 30 ----------------------
 pullDocs.js => sync-docs.js                        | 14 ++++++----
 website/docs/apisix-dashboard/IGNORE_DOC.md        |  1 +
 website/docs/apisix-dashboard/introduction.md      |  6 -----
 website/docs/apisix-dashboard/sidebars.json        |  4 +--
 .../docs/apisix-ingress-controller/IGNORE_DOC.md   |  1 +
 .../docs/apisix-ingress-controller/introduction.md |  6 -----
 .../docs/apisix-ingress-controller/sidebars.json   |  4 +--
 website/docs/apisix/IGNORE_DOC.md                  |  1 +
 website/docs/apisix/introduction.md                |  6 -----
 website/docs/apisix/sidebars.json                  |  4 +--
 website/docusaurus.config.js                       |  8 +++---
 website/src/pages/docs.js                          |  2 +-
 website/src/pages/index.js                         |  2 +-
 15 files changed, 29 insertions(+), 69 deletions(-)

diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index 7f3ec3f..90771f0 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -9,7 +9,7 @@ on:
     branches: [master]
   schedule:
     # Run everyday at 9:00 AM (See https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html#tag_20_25_07)
-    - cron: "0 9 * * *"
+    - cron: "0 5 * * *"
 
 # A workflow run is made up of one or more jobs that can run sequentially or in parallel
 jobs:
@@ -22,6 +22,13 @@ jobs:
     steps:
       # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
       - uses: actions/checkout@v2
+      - uses: actions/setup-node@v2
+        with:
+          node-version: "12"
+
+      - name: Pull Docs
+        run: |
+          node sync-docs.js && git status
 
       - name: Build
         run: |
diff --git a/.github/workflows/updateDocs.yaml b/.github/workflows/updateDocs.yaml
deleted file mode 100644
index 924174a..0000000
--- a/.github/workflows/updateDocs.yaml
+++ /dev/null
@@ -1,30 +0,0 @@
-name: Sync Docs from projects
-
-on:
-  push:
-    branches: [master]
-  schedule:
-    # Run everyday at 6:00 AM (See https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html#tag_20_25_07)
-    - cron: "0 6 * * *"
-
-jobs:
-  pull-docs:
-    runs-on: ubuntu-latest
-
-    steps:
-      - uses: actions/checkout@v2
-      - uses: actions/setup-node@v2
-        with:
-          node-version: "12"
-
-      - name: Pull Docs
-        run: |
-          node pullDocs.js && git status
-
-      - name: Add & Commit
-        run: |
-          git config user.name github-actions
-          git config user.email github-actions@github.com
-          git add .
-          git commit -m "docs: update docs (by GitHub Action)"
-          git push
diff --git a/pullDocs.js b/sync-docs.js
similarity index 89%
rename from pullDocs.js
rename to sync-docs.js
index 8a055a7..abbe52e 100644
--- a/pullDocs.js
+++ b/sync-docs.js
@@ -1,9 +1,10 @@
-console.log("Start pullDocs.js");
+console.log("Start sync-docs.js");
 
 const childProcess = require("child_process");
 const fs = require("fs");
 
-const projects = ["apisix", "apisix-dashboard", "apisix-ingress-controller"];
+// NOTE: disable "apisix", "apisix-dashboard" currently
+const projects = ["apisix-ingress-controller"];
 
 const projectPaths = projects.map((project) => {
   return {
@@ -38,7 +39,10 @@ const replaceMDImageUrl = (project, paths) => {
         .match(/\((.+?)\)/g)[0]
         .replace("(", "")
         .replace(")", "")
-        .replaceAll("../", "");
+        .replace("../", "")
+        .replace("../", "")
+        .replace("../", "")
+        .replace("../", "");
       const newUrl = `(https://raw.githubusercontent.com/apache/${project}/master/docs/${imgPath})`;
       const result = match.replace(match.match(/\((.+?)\)/g)[0], newUrl);
       console.log(result);
@@ -48,9 +52,9 @@ const replaceMDImageUrl = (project, paths) => {
 
   try {
     const results = replace.sync(options);
-    console.log("Replacement results:", results);
+    console.log(`${project} - Replacement results:`, results);
   } catch (error) {
-    console.error("Error occurred:", error);
+    console.error(`${project} - Error occurred:`, error);
   }
 };
 
diff --git a/website/docs/apisix-dashboard/IGNORE_DOC.md b/website/docs/apisix-dashboard/IGNORE_DOC.md
new file mode 100644
index 0000000..cb65e30
--- /dev/null
+++ b/website/docs/apisix-dashboard/IGNORE_DOC.md
@@ -0,0 +1 @@
+# IGNORE_DOC
diff --git a/website/docs/apisix-dashboard/introduction.md b/website/docs/apisix-dashboard/introduction.md
deleted file mode 100644
index a31cf48..0000000
--- a/website/docs/apisix-dashboard/introduction.md
+++ /dev/null
@@ -1,6 +0,0 @@
----
-id: introduction
-title: Introduction
----
-
-Coming Soon
diff --git a/website/docs/apisix-dashboard/sidebars.json b/website/docs/apisix-dashboard/sidebars.json
index 69eddeb..b0cd5aa 100644
--- a/website/docs/apisix-dashboard/sidebars.json
+++ b/website/docs/apisix-dashboard/sidebars.json
@@ -1,5 +1,3 @@
 {
-  "docs": {
-    "APISIX™️ Dashboard": ["introduction"]
-  }
+  "docs": {}
 }
diff --git a/website/docs/apisix-ingress-controller/IGNORE_DOC.md b/website/docs/apisix-ingress-controller/IGNORE_DOC.md
new file mode 100644
index 0000000..cb65e30
--- /dev/null
+++ b/website/docs/apisix-ingress-controller/IGNORE_DOC.md
@@ -0,0 +1 @@
+# IGNORE_DOC
diff --git a/website/docs/apisix-ingress-controller/introduction.md b/website/docs/apisix-ingress-controller/introduction.md
deleted file mode 100644
index a31cf48..0000000
--- a/website/docs/apisix-ingress-controller/introduction.md
+++ /dev/null
@@ -1,6 +0,0 @@
----
-id: introduction
-title: Introduction
----
-
-Coming Soon
diff --git a/website/docs/apisix-ingress-controller/sidebars.json b/website/docs/apisix-ingress-controller/sidebars.json
index 9321733..b0cd5aa 100644
--- a/website/docs/apisix-ingress-controller/sidebars.json
+++ b/website/docs/apisix-ingress-controller/sidebars.json
@@ -1,5 +1,3 @@
 {
-  "docs": {
-    "APISIX™️ Ingress Controller": ["introduction"]
-  }
+  "docs": {}
 }
diff --git a/website/docs/apisix/IGNORE_DOC.md b/website/docs/apisix/IGNORE_DOC.md
new file mode 100644
index 0000000..cb65e30
--- /dev/null
+++ b/website/docs/apisix/IGNORE_DOC.md
@@ -0,0 +1 @@
+# IGNORE_DOC
diff --git a/website/docs/apisix/introduction.md b/website/docs/apisix/introduction.md
deleted file mode 100644
index a31cf48..0000000
--- a/website/docs/apisix/introduction.md
+++ /dev/null
@@ -1,6 +0,0 @@
----
-id: introduction
-title: Introduction
----
-
-Coming Soon
diff --git a/website/docs/apisix/sidebars.json b/website/docs/apisix/sidebars.json
index 03c3d64..b0cd5aa 100644
--- a/website/docs/apisix/sidebars.json
+++ b/website/docs/apisix/sidebars.json
@@ -1,5 +1,3 @@
 {
-  "docs": {
-    "APISIX™️": ["introduction"]
-  }
+  "docs": {}
 }
diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js
index 01af217..08472fc 100644
--- a/website/docusaurus.config.js
+++ b/website/docusaurus.config.js
@@ -142,7 +142,7 @@ module.exports = {
         {
           label: "Docs",
           position: "right",
-          to: "/docs",
+          // to: "/docs",
           items: [
             {
               label: "General",
@@ -150,15 +150,15 @@ module.exports = {
             },
             {
               label: "APISIX™️",
-              to: "/docs/apisix/introduction",
+              to: "/docs/apisix",
             },
             {
               label: "APISIX™️ Dashboard",
-              to: "/docs/dashboard/introduction",
+              to: "/docs/dashboard",
             },
             {
               label: "APISIX™️ Ingress Controller",
-              to: "/docs/ingress-controller/install",
+              to: "/docs/ingress-controller/design",
             },
           ],
         },
diff --git a/website/src/pages/docs.js b/website/src/pages/docs.js
index ec230d4..18e4ea5 100644
--- a/website/src/pages/docs.js
+++ b/website/src/pages/docs.js
@@ -120,7 +120,7 @@ const ProjectCard = (props) => {
     );
 
   return (
-    <Card href={`/docs/${nameInParamCase}/test`}>
+    <Card href={`/docs/${nameInParamCase}`}>
       <Title>
         <ShapeBeforeTitle color={color}>{shapeComponent}</ShapeBeforeTitle>
         {name}
diff --git a/website/src/pages/index.js b/website/src/pages/index.js
index b9f152e..7abab75 100644
--- a/website/src/pages/index.js
+++ b/website/src/pages/index.js
@@ -108,7 +108,7 @@ const LearnHow = () => (
           <div className="col">
             <img
               className="image"
-              src="https://github.com/apache/apisix/blob/master/doc/images/apisix.png?raw=true"
+              src="https://github.com/apache/apisix/blob/master/docs/assets/images/apisix.png?raw=true"
               align="right"
               alt="apisix-description"
             />