From e6b605f793d05fbde961ddcafc5f53ee17cb8a84 Mon Sep 17 00:00:00 2001 From: Leonardo Valencia Date: Thu, 10 May 2018 07:27:29 -0500 Subject: [PATCH] docs: add heroku deploy instructions (#366) --- docs/guide/deploy.md | 48 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/docs/guide/deploy.md b/docs/guide/deploy.md index 607fb988ce..fd78004c1f 100644 --- a/docs/guide/deploy.md +++ b/docs/guide/deploy.md @@ -131,4 +131,50 @@ pages: 3. Deploy to surge, by typing `surge docs/.vuepress/dist`. -You can also deploy to a [custom domain](http://surge.sh/help/adding-a-custom-domain) by adding `surge docs/.vuepress/dist yourdomain.com`. \ No newline at end of file +You can also deploy to a [custom domain](http://surge.sh/help/adding-a-custom-domain) by adding `surge docs/.vuepress/dist yourdomain.com`. + +## Heroku + +1. First install [Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli). + +2. Heroku Account – [sign up here](https://signup.heroku.com). + +3. Run heroku login in your terminal or command prompt and fill in your Heroku credentials. + +``` bash +heroku login +``` + +4. Create a file called `static.json` in the root of your project with the content below. This is the configuration of your site. see more at [heroku-buildpack-static](https://github.com/heroku/heroku-buildpack-static). + +`static.json`: +```json +{ + "root": "./docs/.vuepress/dist" +} +``` + +5. Set up your heroku git remote + +``` bash +# version change +git init +git add . +git commit -m "My site ready for deployment." + +# created app heroku (personalize name for the app) +heroku apps:create my-static-site-example + +# set buildpack for static sites +heroku buildpacks:set https://github.com/heroku/heroku-buildpack-static.git +``` + +6. Deploying Your Site + +``` bash +# publish site +git push heroku master + +# open site for visualize result +heroku open +```