diff --git a/.github/workflows/document-deploy.yml b/.github/workflows/document-deploy.yml index 603b35fbb3..3d2a730b63 100644 --- a/.github/workflows/document-deploy.yml +++ b/.github/workflows/document-deploy.yml @@ -32,3 +32,14 @@ jobs: BUILD_SCRIPT: cd document && yarn && yarn docs:build BUILD_DIR: docs/.vuepress/dist/ CNAME: cosid.ahoo.me + + - name: Build and Deploy With Site Base + uses: jenkey2011/vuepress-deploy@master + env: + SITE_BASE: /cosid/ + ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} + TARGET_REPO: Ahoo-Wang/CosId + TARGET_BRANCH: gh-pages-with-site-base + BUILD_SCRIPT: cd document && yarn && yarn docs:build + BUILD_DIR: docs/.vuepress/dist/ + CNAME: cosid.ahoo.me \ No newline at end of file diff --git a/document/docs/.vuepress/config.ts b/document/docs/.vuepress/config.ts index 6d5967c108..57c2c527d0 100644 --- a/document/docs/.vuepress/config.ts +++ b/document/docs/.vuepress/config.ts @@ -15,10 +15,13 @@ import { NavItemsZH, SidebarZH } from './config/index' +const siteBase: `/${string}/` = process.env.SITE_BASE || "/" + +console.log('Configured SiteBase is:' + siteBase) + const GM_ID = 'G-SP6EEGK56L' export default defineConfig(ctx => ({ - base: '', head: [ ['link', {rel: 'icon', href: `/favicon.ico`}], [ @@ -84,5 +87,6 @@ export default defineConfig(ctx => ({ ['vuepress-plugin-flowchart'] ], extraWatchFiles: ['.vuepress/config/**'], - evergreen: !ctx.isProd + evergreen: !ctx.isProd, + base: siteBase }));