[Vuejs]-Github and vue.Js

0👍

Thanks for your answers guys.

If it can help others.

On Ubuntu, with VSCode I created the deploy.sh file:

#!/usr/bin/env sh

# abort on errors
set -e

# build
npm run build

# navigate into the build output directory
cd dist
    
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:<USERNAME>/<REPO>.git master:gh-pages


cd -

then I entered following code in terminal of vscode:

chmod +x deploy.sh

then

ssh-keygen -t ed25519 -C "<Your@email.com>"
  • copy the key
  • go to settings in Github
  • Add new SSH Key

Then go to package.json and add "deploy":"sh deploy.sh" in scripts:

"scripts":{
"deploy":"sh deploy.sh"
},

then in Terminal:

npm run deploy

In github go to:

  • your repository
  • chose "gh-pages" branch
  • go to settings
  • go to Pages
  • chose -> Branch: gh-pages
  • Then click on the link.

Thank you everyone and have a nice day.
And sorry for my poor English 😉

Leave a comment