Skip to content

Commit e37da59

Browse files
serixscorpioyyx990803
authored andcommitted
docs: Add the GitHub Pages platform guide (#1872)
1 parent 53899a1 commit e37da59

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

docs/guide/deployment.md

+17-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,23 @@ If you are using the PWA plugin, your app must be served over HTTPS so that [Ser
3535

3636
### GitHub Pages
3737

38-
> TODO | Open to contribution.
38+
There are a few different ways to deploy as described by [GitHub Pages documentation](https://help.github.com/articles/configuring-a-publishing-source-for-github-pages/). One way is to publish using a `/docs` folder on `master` branch.
39+
40+
Create an initial `vue.config.js` file to [update the `outputDir`](https://cli.vuejs.org/config/#outputdir) value to match `docs`. Typically, your static website will be hosted on https://yourUserName.github.io/yourProjectName, so you will also want to [update the `BASE_URL`](https://github.com/vuejs/vue-cli/tree/dev/docs/config#baseurl) value to match:
41+
42+
```javascript
43+
// vue.config.js file to be place in the root of your repository
44+
// make sure you update `yourProjectName` with the name of your GitHub project
45+
46+
module.exports = {
47+
baseUrl: process.env.NODE_ENV === 'production'
48+
? '/yourProjectName/'
49+
: '/',
50+
outputDir: 'docs'
51+
}
52+
```
53+
54+
Generate the production build in `docs` directory with `npm run build`. Commit the `vue.config.js` file and the built files `docs/*`, then push to your repository's `master` branch. On GitHub, configure your repository's setting to [Publish your GitHub Pages site from a `docs` folder on your `master` branch](https://help.github.com/articles/configuring-a-publishing-source-for-github-pages/#publishing-your-github-pages-site-from-a-docs-folder-on-your-master-branch)
3955

4056
### GitLab Pages
4157

0 commit comments

Comments
 (0)