Try โ€‚โ€‰HackMD

Vue env variable and github-page deploy

Vue set environment variable

Vue deploy on github page

โ€‹โ€‹โ€‹โ€‹---
โ€‹โ€‹โ€‹โ€‹- should set repos to public
โ€‹โ€‹โ€‹โ€‹- customize settting for those two file (<>) 
โ€‹โ€‹โ€‹โ€‹- delete # use you want in deploy.js
โ€‹โ€‹โ€‹โ€‹---
โ€‹โ€‹โ€‹โ€‹> my-project/vue.config.js
โ€‹โ€‹โ€‹โ€‹    
โ€‹โ€‹โ€‹โ€‹        module.exports = {
โ€‹โ€‹โ€‹โ€‹          publicPath: process.env.NODE_ENV === 'production' ? '/<repo-name>/' : '/',
โ€‹โ€‹โ€‹โ€‹        };
โ€‹โ€‹โ€‹โ€‹---
โ€‹โ€‹โ€‹โ€‹> my-project/deploy.s
โ€‹โ€‹โ€‹โ€‹
โ€‹โ€‹โ€‹โ€‹    #!/usr/bin/env sh

โ€‹โ€‹โ€‹โ€‹    # abort on errors
โ€‹โ€‹โ€‹โ€‹    set -e

โ€‹โ€‹โ€‹โ€‹    # build
โ€‹โ€‹โ€‹โ€‹    npm run build

โ€‹โ€‹โ€‹โ€‹    # navigate into the build output directory
โ€‹โ€‹โ€‹โ€‹    cd dist

โ€‹โ€‹โ€‹โ€‹    # if you are deploying to a custom domain
โ€‹โ€‹โ€‹โ€‹    # echo 'www.example.com' > CNAME

โ€‹โ€‹โ€‹โ€‹    git init
โ€‹โ€‹โ€‹โ€‹    git add -A
โ€‹โ€‹โ€‹โ€‹    git commit -m 'deploy'

โ€‹โ€‹โ€‹โ€‹    # if you are deploying to https://<USERNAME>.github.io
โ€‹โ€‹โ€‹โ€‹    # git push -f git@github.com:<USERNAME>/<USERNAME>.github.io.git master

โ€‹โ€‹โ€‹โ€‹    # if you are deploying to https://<USERNAME>.github.io/<REPO>
โ€‹โ€‹โ€‹โ€‹    # git push -f git@github.com:<USERNAME>/<REPO>.git master:gh-pages

โ€‹โ€‹โ€‹โ€‹    cd -
โ€‹โ€‹โ€‹โ€‹
โ€‹โ€‹โ€‹โ€‹---

โ€‹โ€‹โ€‹โ€‹        sh ./deploy.sh    //run this in terminal to deploy