I'm using VueJS 2 in my project and I realized that my build deployment is bad.
This is my script to deploy my VueJS build on github :
#!/usr/bin/env sh
# abort on errors
set -e
# build
cd ../..
VUE_APP_ENV=demo vue-cli-service build
# navigate into the build output directory
cd dist
git init
git add -A
git commit -m 'deploy'
git push -f git@github.com:MyRepo/my-project.git master:my-project-demo-deployment
cd -
rm -rf dist/
After that, I go to my remote server and I get the new build with this command:
git pull origin --rebase
I'm using this command because I don't have git history so I can't pull. Each time the build is deleted because I delete the dist/ folder.
But this way to deploy my build on remote server is not very good because I can't easily come back to a previous commit because I have one and only commit each time I build/push.
I want to know if there is a solution to deploy all my different builds on the github to do normally git pull my new build on the remote server. I have to edit my script but I don't know what is the best solution. Maybe I have to create another repo to store all my build commits ? I don't know. I hope you can help me.

