diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..62ef70b --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,60 @@ +pipeline { + agent any + tools { + nodejs 'node-v18.18.2' // 使用全局配置的Node.js工具 + } + + stages { + stage('Checkout') { + steps { + // 从Git仓库克隆项目 + checkout scmGit(branches: [[name: '*/master']], extensions: [], userRemoteConfigs: [[credentialsId: '4a774ecd-6ae3-4e27-a5e6-e6488b93b28a', url: 'https://gitea.1216.top/lxy/z-docs.git']]) + } + } + + stage('Install Dependencies') { + steps { + // 使用配置的Node.js版本安装项目依赖 + sh ''' + npm config set registry https://registry.npmmirror.com/ + npm install + ''' + } + } + + stage('Build') { + steps { + // 执行构建步骤,比如打包 + sh 'npm run build' // 假设你的package.json中有一个名为build的脚本用于打包 + } + } + + stage('deploy') { + steps { + sshPublisher(publishers: [sshPublisherDesc( + configName: 'u-xg', // SSH服务器的配置名称 + transfers: [sshTransfer( + cleanRemote: false, + execCommand: ''' + // 这里可以添加在远程机器上执行的其他命令 + cd /var/www + rm zhub-docs -rf + mv z-docs zhub-docs + ''', + execTimeout: 120000, + flatten: false, // 是否将源文件扁平化到单个目录中 + makeEmptyDirs: true, // 是否创建远程目录结构 + noDefaultExcludes: false, + patternSeparator: '[, ]+', + remoteDirectory: '/var/www/z-docs', // 远程机器上的目标目录 + removePrefix: 'dist/', // 如果需要,从源文件名中移除的前缀 + sourceFiles: 'dist/**' // 要传输的文件模式,这里表示dist目录及其所有内容 + )], + usePromotionTimestamp: false, + useWorkspaceInPromotion: false, + verbose: true // 设置为true以获取更详细的日志输出 + )]) + } + } + } +} \ No newline at end of file diff --git a/back/oth/_category_.json b/docs/oth/_category_.json similarity index 100% rename from back/oth/_category_.json rename to docs/oth/_category_.json diff --git a/back/oth/a.md b/docs/oth/a.md similarity index 100% rename from back/oth/a.md rename to docs/oth/a.md diff --git a/back/tutorial-basics/_category_.json b/docs/tutorial-basics/_category_.json similarity index 100% rename from back/tutorial-basics/_category_.json rename to docs/tutorial-basics/_category_.json diff --git a/back/tutorial-basics/broadcast.md b/docs/tutorial-basics/broadcast.md similarity index 100% rename from back/tutorial-basics/broadcast.md rename to docs/tutorial-basics/broadcast.md diff --git a/back/tutorial-basics/create-connection.md b/docs/tutorial-basics/create-connection.md similarity index 100% rename from back/tutorial-basics/create-connection.md rename to docs/tutorial-basics/create-connection.md diff --git a/back/tutorial-basics/delay.md b/docs/tutorial-basics/delay.md similarity index 100% rename from back/tutorial-basics/delay.md rename to docs/tutorial-basics/delay.md diff --git a/back/tutorial-basics/publish-subscribe.md b/docs/tutorial-basics/publish-subscribe.md similarity index 100% rename from back/tutorial-basics/publish-subscribe.md rename to docs/tutorial-basics/publish-subscribe.md diff --git a/back/tutorial-extras/_category_.json b/docs/tutorial-extras/_category_.json similarity index 100% rename from back/tutorial-extras/_category_.json rename to docs/tutorial-extras/_category_.json diff --git a/back/tutorial-extras/img/docsVersionDropdown.png b/docs/tutorial-extras/img/docsVersionDropdown.png similarity index 100% rename from back/tutorial-extras/img/docsVersionDropdown.png rename to docs/tutorial-extras/img/docsVersionDropdown.png diff --git a/back/tutorial-extras/img/localeDropdown.png b/docs/tutorial-extras/img/localeDropdown.png similarity index 100% rename from back/tutorial-extras/img/localeDropdown.png rename to docs/tutorial-extras/img/localeDropdown.png diff --git a/back/tutorial-extras/lock.md b/docs/tutorial-extras/lock.md similarity index 100% rename from back/tutorial-extras/lock.md rename to docs/tutorial-extras/lock.md diff --git a/back/tutorial-extras/rpc.md b/docs/tutorial-extras/rpc.md similarity index 100% rename from back/tutorial-extras/rpc.md rename to docs/tutorial-extras/rpc.md diff --git a/back/tutorial-extras/timer.md b/docs/tutorial-extras/timer.md similarity index 100% rename from back/tutorial-extras/timer.md rename to docs/tutorial-extras/timer.md diff --git a/docusaurus.config.js b/docusaurus.config.js index 6afa7af..75d9d30 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -11,7 +11,7 @@ const config = { favicon: 'img/favicon.ico', // Set the production url of your site here - url: 'https://zhub.1216.top', + url: 'https://zhub.dev', // Set the // pathname under which your site is served // For GitHub pages deployment, it is often '//' baseUrl: '/', diff --git a/src/css/custom.css b/src/css/custom.css index 3672aad..916c711 100644 --- a/src/css/custom.css +++ b/src/css/custom.css @@ -6,7 +6,7 @@ /* You can override the default Infima variables here. */ :root { - --ifm-color-primary: #852e79; + --ifm-color-primary: #2e4785; --ifm-color-primary-dark: #29784c; --ifm-color-primary-darker: #277148; --ifm-color-primary-darkest: #205d3b; @@ -19,7 +19,7 @@ /* For readability concerns, you should choose a lighter palette in dark mode. */ [data-theme='dark'] { - --ifm-color-primary: #852e79; + --ifm-color-primary: #475c98; --ifm-color-primary-dark: #21af90; --ifm-color-primary-darker: #1fa588; --ifm-color-primary-darkest: #1a8870;