Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add heroku deployment guide #3777

Merged
merged 4 commits into from Jun 23, 2019
Merged

Add heroku deployment guide #3777

merged 4 commits into from Jun 23, 2019

Conversation

zigomir
Copy link
Contributor

@zigomir zigomir commented Apr 8, 2019

I see there are many other guides for heroku proposed:

But all of them include some sort of node server which isn't really required with heroku-buildpack-static buildpack.

I'd argue that, this is the easiest and most straightforward way to deploy vue-cli app to heroku ;)

@aislanmaia
Copy link

So, how is the "easiest way"? I mean, how to deploy to heroku using vue-cli?

@zigomir
Copy link
Contributor Author

zigomir commented Apr 28, 2019

@aislanmaia see insturcitons in https://github.com/vuejs/vue-cli/pull/3777/files

I just deployed a fresh vue-cli app to heroku, without needing to add any other packages like other pull requests do – that's why I claim this is the easiest.

It also handles SPA correctly and serves index.html for all routes.

@sodatea whom should I bother to review this PR?

@aislanmaia
Copy link

Oh man.. many thanks for the instructions. I was right now trying to deploy with vue-cli but got error into the heroku app without the serve package, because heroku can't found vue-cli-service command.
I found that I was missing to add heroku-buildpack.

@aislanmaia
Copy link

@zigomir what you put in the start script into package.json
Heroku logs error missing that part.

Here is my scripts:

"scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "lint": "vue-cli-service lint",
    "heroku-postbuild": "npm run build"
},

@zigomir
Copy link
Contributor Author

zigomir commented Apr 30, 2019

@aislanmaia I think that adding heroku buildpacks:add heroku/nodejs will pick up build automatically. But would need to check.

@aislanmaia
Copy link

I have tested it out. It works with the buildpacks. But I have ditched Heroku because I'm using Cloudinary service to my images processing, and whatever you want, Heroku forces you to install addons. I'm using now firebase hosting that works straight forward with the libs my static frontend is using.

@zigomir zigomir mentioned this pull request May 10, 2019
@NataliaTepluhina
Copy link
Member

@zigomir thank you for creating this PR! However, it missed a step for Heroku CLI installation. Would you mind to add it to the guide?

Also split instructions into steps
@zigomir
Copy link
Contributor Author

zigomir commented Jun 13, 2019

@NataliaTepluhina done. I just added a link as heroku has different installers for each platform.

@NataliaTepluhina
Copy link
Member

@zigomir tested it and it looks like definitely the easiest way to deploy to Heroku. Left one minor suggestion, as soon as it's resolved I will merge.

Co-Authored-By: Natalia Tepluhina <NataliaTepluhina@users.noreply.github.com>
@zigomir
Copy link
Contributor Author

zigomir commented Jun 21, 2019

@NataliaTepluhina thanks, done!

Co-Authored-By: Natalia Tepluhina <NataliaTepluhina@users.noreply.github.com>
@vue-bot
Copy link

vue-bot commented Jun 23, 2019

Hey @zigomir, thank you for your time and effort spent on this PR, contributions like yours help make Vue better for everyone. Cheers! 💚

@zigomir zigomir deleted the patch-1 branch June 23, 2019 15:01
sodatea pushed a commit that referenced this pull request Jun 24, 2019
* Add heroku deployment description

* Link to heroku CLI article

Also split instructions into steps

* Use heroku org buildpack link

Co-Authored-By: Natalia Tepluhina <NataliaTepluhina@users.noreply.github.com>

* Update docs/guide/deployment.md

Co-Authored-By: Natalia Tepluhina <NataliaTepluhina@users.noreply.github.com>
(cherry picked from commit 323acc9)
@neillsom
Copy link

neillsom commented Aug 1, 2019

When deploying to heroku I keep running into the error "npm ERR! missing script: start"

I was able to get the app running properly by adding a start script to package.json

	"scripts": {
		"serve": "vue-cli-service serve",
		"start": "vue-cli-service serve",
		"build": "vue-cli-service build",
		"lint": "vue-cli-service lint"
	},

@zigomir
Copy link
Contributor Author

zigomir commented Aug 1, 2019

@neillsom are you using both buildpacks mentioned in this PR?

heroku buildpacks:add heroku/nodejs
heroku buildpacks:add https://github.com/heroku/heroku-buildpack-static

@neillsom
Copy link

neillsom commented Aug 1, 2019

@neillsom are you using both buildpacks mentioned in this PR?

heroku buildpacks:add heroku/nodejs
heroku buildpacks:add https://github.com/heroku/heroku-buildpack-static

My mistake! I had github auto-deploying, so the heroku commands I was running from the command line were for the wrong remote 🤦 Thanks for helping me track it down

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants