WmTools Blog

Command Line Deploy Nuxt on GitHub Pages

You can publish your website that you developed with nuxt on the Github page. You need to generate your static web application.

Deploy Nuxt on GitHub Pages

You can publish your website that you developed with nuxt on the Github page. You need to generate your static web application.

Command-line Deployment

You need to use the push-dir package. You can install the push-dir package with the following command.

npm install push-dir --save-dev

Add a deploy command to your package.json with the branch as gh-pages for project repository OR master for user or organization site.

"scripts": {
    "dev": "nuxt",
    "generate": "nuxt generate",
    "start": "nuxt start",
    "deploy": "push-dir --dir=dist --branch=gh-pages --cleanup"
},

Then generate and deploy your static application:

npm run generate
npm run deploy
WmTools Blog 2022 | webmaster blog v1