Skip to content

Commit d4dacba

Browse files
chen-jyyx990803
authored andcommitted
docs: add deploy guide for GitLab pages + GitLab CI (#219)
1 parent 5a175c3 commit d4dacba

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

Diff for: docs/guide/deploy.md

+31
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,37 @@ git commit -m 'deploy'
5656
cd -
5757
```
5858

59+
## GitLab Pages and GitLab CI
60+
61+
1. Set correct `base` in `docs/.vuepress/config.js`.
62+
63+
If you are deploying to `https://<USERNAME or GROUP>.gitlab.io/`, you can omit `base` as it defaults to `"/"`.
64+
65+
If your are deploying to `https://<USERNAME or GROUP>.gitlab.io/<REPO>/`, (i.e. your repository is at `https://gitlab.com/<USERNAME>/REPO>`), set `base` to `"/<REPO>/"`.
66+
67+
2. Set `dest` in `.vuepress/config.js` to `public`.
68+
69+
3. Create a file called `.gitlab-ci.yml` in the root of your project with the content below. This will build and deploy your site whenever you make changes to your content.
70+
71+
```
72+
image: node:9.11.1
73+
74+
pages:
75+
cache:
76+
paths:
77+
- node_modules/
78+
79+
script:
80+
- npm install
81+
- npm run docs:build
82+
artifacts:
83+
paths:
84+
- public
85+
only:
86+
- master
87+
```
88+
89+
5990
## Netlify
6091

6192
1. On Netlify, setup up a new project from GitHub with the following settings:

0 commit comments

Comments
 (0)