Skip to content

Commit

Permalink
docs: update deploy.md for Now 2.0 (#1142)
Browse files Browse the repository at this point in the history
  • Loading branch information
B3nnyL authored and ulivz committed Jan 8, 2019
1 parent ede57b0 commit 0ff1d6e
Showing 1 changed file with 12 additions and 19 deletions.
31 changes: 12 additions & 19 deletions packages/docs/docs/guide/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,34 +185,27 @@ heroku open

1. Install the Now CLI globally: `npm install -g now`

2. Add a `docs.now.json` file to your project root:
2. Add a `now.json` file to your project root:

```json
{
"name": "my-cool-docs",
"type": "static",
"static": {
"public": "docs/.vuepress/dist"
},
"alias": "my-cool-docs",
"files": [
"docs/.vuepress/dist"
]
}
"version": 2,
"name": "vuepress",
"alias": "vuepress.now.sh",
"builds": [{
"src": "package.json",
"use": "@now/static-build"
}]
}
```

You can further customize the static serving behavior by consulting [Now's documentation](https://zeit.co/docs/deployment-types/static).
You can further customize the static serving behavior by consulting [Now's documentation](https://zeit.co/examples/vuepress/).

3. Adding a deployment script in `package.json`:

```json
"docs:deploy": "npm run docs:build && now --local-config docs.now.json && now alias --local-config docs.now.json"
```

If you want to deploy publicly by default, you can change the deployment script to the following one:

```json
"docs:deploy": "npm run docs:build && now --public --local-config docs.now.json && now alias --local-config docs.now.json"
"now-build": "npm run docs:build && mv docs/.vuepress/dist dist"
"docs:deploy": "now && now alias"
```

This will automatically point your site's alias to the latest deployment. Now, just run `npm run docs:deploy` to deploy your app.

0 comments on commit 0ff1d6e

Please sign in to comment.