From 1529c68085d8f3302a5cba915f79bef525ffc238 Mon Sep 17 00:00:00 2001 From: postyizhan <185839426@qq.com> Date: Fri, 5 Apr 2024 08:43:43 +0800 Subject: [PATCH] =?UTF-8?q?+=20gitlab=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitlab-ci.yml | 25 +++++++ ...13\350\275\275\344\273\223\345\272\223.md" | 2 +- ...13\350\275\275\344\276\235\350\265\226.md" | 2 +- ...\275\275\345\256\211\350\243\205nodejs.md" | 2 +- "docs/\345\274\200\345\206\262.md" | 2 +- ...04\347\247\215\350\267\257\345\276\204.md" | 2 +- ...346\210\220pdf\346\226\207\344\273\266.md" | 2 +- ...37\346\210\220\347\275\221\351\241\265.md" | 2 +- .../\350\256\276\347\275\256ACCESS_TOKEN.md" | 4 +- ...\275\256Action\346\235\203\351\231\220.md" | 2 +- ...\203\250\347\275\262\345\210\260GitLab.md" | 70 +++++++++++++++++++ 11 files changed, 106 insertions(+), 9 deletions(-) create mode 100644 .gitlab-ci.yml create mode 100644 "docs/\351\203\250\347\275\262\345\210\260GitLab.md" diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 00000000..f242d099 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,25 @@ +image: node:20.12.1 + +stages: + - test + - deploy + +test: + stage: test + script: + - npm install + - npm run build + rules: + - if: $CI_COMMIT_REF_NAME != $CI_DEFAULT_BRANCH + +pages: + stage: deploy + script: + - npm install + - npm run build + - mv ./build ./public + artifacts: + paths: + - public + rules: + - if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH diff --git "a/docs/\344\270\213\350\275\275\344\273\223\345\272\223.md" "b/docs/\344\270\213\350\275\275\344\273\223\345\272\223.md" index cb978e4b..b5988f83 100644 --- "a/docs/\344\270\213\350\275\275\344\273\223\345\272\223.md" +++ "b/docs/\344\270\213\350\275\275\344\273\223\345\272\223.md" @@ -1,5 +1,5 @@ --- -sidebar_position: 6 +sidebar_position: 7 --- # 下载仓库 diff --git "a/docs/\344\270\213\350\275\275\344\276\235\350\265\226.md" "b/docs/\344\270\213\350\275\275\344\276\235\350\265\226.md" index 079f9767..a9954c24 100644 --- "a/docs/\344\270\213\350\275\275\344\276\235\350\265\226.md" +++ "b/docs/\344\270\213\350\275\275\344\276\235\350\265\226.md" @@ -1,5 +1,5 @@ --- -sidebar_position: 7 +sidebar_position: 8 --- # 下载依赖 diff --git "a/docs/\344\270\213\350\275\275\345\256\211\350\243\205nodejs.md" "b/docs/\344\270\213\350\275\275\345\256\211\350\243\205nodejs.md" index 0b9f8ab8..2645e329 100644 --- "a/docs/\344\270\213\350\275\275\345\256\211\350\243\205nodejs.md" +++ "b/docs/\344\270\213\350\275\275\345\256\211\350\243\205nodejs.md" @@ -1,5 +1,5 @@ --- -sidebar_position: 5 +sidebar_position: 6 --- # 下载安装nodejs diff --git "a/docs/\345\274\200\345\206\262.md" "b/docs/\345\274\200\345\206\262.md" index 48adf7dc..88ae8697 100644 --- "a/docs/\345\274\200\345\206\262.md" +++ "b/docs/\345\274\200\345\206\262.md" @@ -1,5 +1,5 @@ --- -sidebar_position: 11 +sidebar_position: 12 --- # 开冲 diff --git "a/docs/\346\233\264\346\224\271\345\220\204\347\247\215\350\267\257\345\276\204.md" "b/docs/\346\233\264\346\224\271\345\220\204\347\247\215\350\267\257\345\276\204.md" index d8adc630..64925dfc 100644 --- "a/docs/\346\233\264\346\224\271\345\220\204\347\247\215\350\267\257\345\276\204.md" +++ "b/docs/\346\233\264\346\224\271\345\220\204\347\247\215\350\267\257\345\276\204.md" @@ -1,5 +1,5 @@ --- -sidebar_position: 8 +sidebar_position: 9 --- # 更改各种路径 diff --git "a/docs/\350\207\252\345\212\250\347\224\237\346\210\220pdf\346\226\207\344\273\266.md" "b/docs/\350\207\252\345\212\250\347\224\237\346\210\220pdf\346\226\207\344\273\266.md" index 3dd0795a..6254f5cd 100644 --- "a/docs/\350\207\252\345\212\250\347\224\237\346\210\220pdf\346\226\207\344\273\266.md" +++ "b/docs/\350\207\252\345\212\250\347\224\237\346\210\220pdf\346\226\207\344\273\266.md" @@ -1,5 +1,5 @@ --- -sidebar_position: 10 +sidebar_position: 11 --- # 自动生成pdf文件 diff --git "a/docs/\350\207\252\345\212\250\347\224\237\346\210\220\347\275\221\351\241\265.md" "b/docs/\350\207\252\345\212\250\347\224\237\346\210\220\347\275\221\351\241\265.md" index 0c1f7c10..a3eee0d6 100644 --- "a/docs/\350\207\252\345\212\250\347\224\237\346\210\220\347\275\221\351\241\265.md" +++ "b/docs/\350\207\252\345\212\250\347\224\237\346\210\220\347\275\221\351\241\265.md" @@ -1,5 +1,5 @@ --- -sidebar_position: 9 +sidebar_position: 10 --- # 自动生成网页 diff --git "a/docs/\350\256\276\347\275\256ACCESS_TOKEN.md" "b/docs/\350\256\276\347\275\256ACCESS_TOKEN.md" index eceddc6e..e5f94e34 100644 --- "a/docs/\350\256\276\347\275\256ACCESS_TOKEN.md" +++ "b/docs/\350\256\276\347\275\256ACCESS_TOKEN.md" @@ -1,5 +1,5 @@ --- -sidebar_position: 3 +sidebar_position: 4 --- # 设置ACCESS_TOKEN @@ -72,6 +72,8 @@ sidebar_position: 3 * `Name`填写`ACCESS_TOKEN`, `Secret`填写你刚才复制的东西 +一定要填写 `ACCESS_TOKEN` 因为 build.yml里写的就是这个名 + ![](_images/ACCESS_TOKEN.png) * 点击下方绿色的`Add secret`按钮 diff --git "a/docs/\350\256\276\347\275\256Action\346\235\203\351\231\220.md" "b/docs/\350\256\276\347\275\256Action\346\235\203\351\231\220.md" index 628f1174..1d45cd92 100644 --- "a/docs/\350\256\276\347\275\256Action\346\235\203\351\231\220.md" +++ "b/docs/\350\256\276\347\275\256Action\346\235\203\351\231\220.md" @@ -1,5 +1,5 @@ --- -sidebar_position: 4 +sidebar_position: 5 --- # 设置Action权限 diff --git "a/docs/\351\203\250\347\275\262\345\210\260GitLab.md" "b/docs/\351\203\250\347\275\262\345\210\260GitLab.md" new file mode 100644 index 00000000..14fd7c97 --- /dev/null +++ "b/docs/\351\203\250\347\275\262\345\210\260GitLab.md" @@ -0,0 +1,70 @@ +--- +sidebar_position: 3 +--- + +在gitlab那边导入这个仓库,或者你把这个仓库下载下来,传gitlab上 + +[.gitlab-ci.yml](/.gitlab-ci.yml) 驿站帮你写好了awa + +然后把 [docusaurus.config.js](/docusaurus.config.js) 里的东西改下 + +:::tip + +在GitLab那一侧的仓库改 + +::: + +找到这一段 + +``` + title: 'Wiki-Template', + tagline: 'Docusaurus 插件文档模板', + favicon: 'img/favicon.ico', + + // Set the production url of your site here + url: 'https://postyizhan.github.io', + // Set the // pathname under which your site is served + // For GitHub pages deployment, it is often '//' + baseUrl: '/Wiki-Template/', + + // GitHub pages deployment config. + // If you aren't using GitHub pages, you don't need these. + organizationName: 'postyizhan', // Usually your GitHub org/user name. + projectName: 'Wiki-Template', // Usually your repo name. + deploymentBranch: 'gh-pages', + trailingSlash: false, +}; +``` + +postyizhan 改成你自己的 `username/groupname` + +`github.io` 改成 `gitlab.io` + +`Wiki-Template` 改成 `username/groupname` + +`baseUrl` 改成 `/` + +`projectName` 改成 `username/groupname` 而不是 你这个文档仓库的名字 + +`` + +比如我的是改成这样 + +``` + title: 'Wiki-Template', + tagline: 'Docusaurus 插件文档模板', + favicon: 'img/favicon.ico', + + // Set the production url of your site here + url: 'https://yizhan.gitlab.io', + // Set the // pathname under which your site is served + // For GitHub pages deployment, it is often '//' + baseUrl: '/', + + // GitHub pages deployment config. + // If you aren't using GitHub pages, you don't need these. + organizationName: 'postyizhan', // Usually your GitHub org/user name. + projectName: 'yizhan', // Usually your repo name. + deploymentBranch: 'gh-pages', + trailingSlash: false, +```