1) First setup GitHub Pages on the GitHub quickstart
2) Install gh-pages package. It can be installed to devDependencies.
NPM
npm i gh-pages
Yarn
yarn add --dev gh-pages
3) Add the following line to your scripts in package.json assuming your application is build to dist/spa directory.
"deploy": "gh-pages -d dist/spa"
E.g.
"scripts": {
"lint": "eslint --ext .js,.vue ./",
"format": "prettier --write \"**/*.{js,vue,scss,html,md,json}\" --ignore-path .gitignore",
"test": "echo \"No test specified\" && exit 0",
"build": "quasar build",
"deploy": "gh-pages -d dist/spa",
"postinstall": "patch-package"
},
4) Build your app. In my example to do that I use the following command
yarn build
5) Deploy app to GitHub pages:
yarn deploy
Top comments (0)