docsify/docs/deploy.md

57 lines
1.3 KiB
Markdown
Raw Normal View History

2017-02-13 22:43:58 +08:00
# Deploy
Similar to [GitBook](https://www.gitbook.com), you can deploy files to GitHub Pages, GitLab Pages or VPS.
2017-02-13 22:43:58 +08:00
## GitHub Pages
2017-03-10 05:19:07 +08:00
There're three places to populate your docs for your Github repository:
2017-02-13 22:43:58 +08:00
2017-03-10 05:19:07 +08:00
* `docs/` folder
* master branch
* gh-pages branch
2017-02-13 22:43:58 +08:00
2017-03-10 05:19:07 +08:00
It is recommended that you save your files to the `./docs` subfolder of the `master` branch of your repository. Then select `master branch /docs folder` as your Github Pages source in your repositories' settings page.
2017-02-13 22:43:58 +08:00
![github pages](_images/deploy-github-pages.png)
2018-01-31 13:13:16 +08:00
!> You can also save files in the root directory and select `master branch`.
You'll need to place a `.nojekyll` file in the deploy location (such as `/docs` or the gh-pages branch
2017-02-13 22:43:58 +08:00
## GitLab Pages
If you are deploying your master branch, include `.gitlab-ci.yml` with the following script:
2017-10-11 17:20:41 +08:00
?> The `.public` workaround is so `cp` doesn't also copy `public/` to itself in an infinite loop.
``` YAML
pages:
stage: deploy
script:
- mkdir .public
- cp -r * .public
- mv .public public
artifacts:
paths:
- public
only:
- master
```
!> You can replace script with `- cp -r docs/. public`, if `./docs` is your Docsify subfolder.
2017-02-13 22:43:58 +08:00
## VPS
Try following nginx config.
```nginx
server {
listen 80;
server_name your.domain.com;
location / {
alias /path/to/dir/of/docs;
index index.html;
}
}
```