1

I have followed the instruction of Vue official website: https://cli.vuejs.org/guide/deployment.html#github-pages

And here are my vue.config.js file and deploy.sh file

module.exports = {
  publicPath:
    process.env.NODE_ENV === "production" ? "/my-project/" : "/",
};

deploy.sh

#!/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/<REPO>
git push -f git@github.com:myUserName/my-project.git main:gh-pages

cd -

I have run sh deploy.sh in my git bash, and have a branch called gh-pages. But when I used gh-pages to deploy my website, it render README.md content. How can I solve this problem and render the page I have made?

syltai
  • 112
  • 1
  • 12
  • This should answer your question: [GitHub pages only showing ReadMe file?](https://stackoverflow.com/questions/48919200/github-pages-only-showing-readme-file). Your problem isn't necessarily with this config– it's with the structure of your project. GitHub Pages, by default, looks for an `index.html` file in your root directory to display, and uses `README.md` as a fallback, which is likely why you're seeing it. You'll likely need to do a little configuration/ setup in the GH Pages settings. – zcoop98 Jul 07 '21 at 21:39
  • 1
    Hi @zcoop98 Thanks for you hint! The problem is solved! I found the index.html file in my /docs folder, and let Github pages redirect to the folder. – syltai Jul 08 '21 at 14:02

0 Answers0