问题
I have made an Angular app with Yeoman and deployed it to heroku. The initial push was fine. I was able to access the website. However, when I made some changes and try to do the git dance:
git add .
git commit -m "message"
git push heroku master
the website is not updated with the new changes even though there is no error occurred during the push.
In order to check if the changes are actually pushed to heroku, I checked out a new branch and make some changes then commit and run:
git add .
git commit -m "new changes"
git push heroku new_branch:master
git co master
git pull heroku master
After that, I am able to see the local master branch is able to pull the new changes from heroku. Therefore, my question is that why the website is not showing the changes. (PS: I ran heroku restart everytime I push to heroku. Also, during pushing, the terminal shows that gifsicle and jsonify seems to not work correctly. Could that be the cause?)
回答1:
For anyone else ending up here with the same question. Make sure you build your client code before you push. I had the exact same problem, spent hours debugging only to realize i had forgotten to run ng-build -prod
before pushing.
My local changes was pushed but my client production code was obviously still the same. ;(
来源:https://stackoverflow.com/questions/35663972/heroku-app-doesnt-get-updated-after-git-push-heroku-master