mirror of
https://github.com/wahyd4/vuepress.git
synced 2026-08-10 05:46:31 +10:00
1.2 KiB
1.2 KiB
Deploying
The following guides assumes you are placing your docs inside the docs directory of your project and using the default build output location.
GitHub Pages
-
Set
basein.vuepress/config.jsto your repository's name. For example, if your repository ishttps://github.com/foo/bar, the deployed pages will be available athttps://foo.github.io/bar. In this case, you should setbaseto"/bar/". -
Inside your project, run:
# build
vuepress build docs
# navigate into the build output directory
cd docs/.vuepress/dist
git init
git add -A
git commit -m 'deploy'
# push to the gh-pages branch of your repo.
# replace <USERNAME>/<REPO> with your info
git push -f git@github.com:<USERNAME>/<REPO>.git master:gh-pages
You can run this script in your CI setup to enable automatic deployment on each push.
Netlify
- Make sure you have npm scripts for building your docs:
{
"scripts": {
"docs:build": "vuepress build docs"
}
}
- On Netlify, setup up a new project from GitHub with the following settings:
- Build Command:
npm run docs:buildoryarn docs:build - Publish directory:
docs/.vuepress/dist
- Hit the deploy button!