Skip to content

[Doc] Update deploy.md for Now 2.0 #1142

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

Merged
merged 2 commits into from
Jan 8, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.