Skip to content

Commit

Permalink
+ gitlab支持
Browse files Browse the repository at this point in the history
  • Loading branch information
postyizhan committed Apr 5, 2024
1 parent 49e70c3 commit 1529c68
Show file tree
Hide file tree
Showing 11 changed files with 106 additions and 9 deletions.
25 changes: 25 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion docs/下载仓库.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 6
sidebar_position: 7
---

# 下载仓库
Expand Down
2 changes: 1 addition & 1 deletion docs/下载依赖.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 7
sidebar_position: 8
---

# 下载依赖
Expand Down
2 changes: 1 addition & 1 deletion docs/下载安装nodejs.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 5
sidebar_position: 6
---

# 下载安装nodejs
Expand Down
2 changes: 1 addition & 1 deletion docs/开冲.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 11
sidebar_position: 12
---

# 开冲
Expand Down
2 changes: 1 addition & 1 deletion docs/更改各种路径.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 8
sidebar_position: 9
---

# 更改各种路径
Expand Down
2 changes: 1 addition & 1 deletion docs/自动生成pdf文件.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 10
sidebar_position: 11
---

# 自动生成pdf文件
Expand Down
2 changes: 1 addition & 1 deletion docs/自动生成网页.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 9
sidebar_position: 10
---

# 自动生成网页
Expand Down
4 changes: 3 additions & 1 deletion docs/设置ACCESS_TOKEN.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 3
sidebar_position: 4
---

# 设置ACCESS_TOKEN
Expand Down Expand Up @@ -72,6 +72,8 @@ sidebar_position: 3

* `Name`填写`ACCESS_TOKEN`, `Secret`填写你刚才复制的东西

一定要填写 `ACCESS_TOKEN` 因为 build.yml里写的就是这个名

![](_images/ACCESS_TOKEN.png)

* 点击下方绿色的`Add secret`按钮
Expand Down
2 changes: 1 addition & 1 deletion docs/设置Action权限.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 4
sidebar_position: 5
---

# 设置Action权限
Expand Down
70 changes: 70 additions & 0 deletions docs/部署到GitLab.md
Original file line number Diff line number Diff line change
@@ -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 /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
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 /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
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,
```

0 comments on commit 1529c68

Please sign in to comment.