-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
docs(v2): add instructions on Travis CI deployment #2289
Merged
Merged
Changes from 2 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
02d1b36
docs: update versioned_docs/deployment with travis-ci
mohamedsgap 97f7a3a
docs: update docs/deployment with travis-ci
mohamedsgap 940ddb6
Transfer update to a new version
mohamedsgap 02e5530
Update node version
mohamedsgap 0377cf0
Merge branch 'master' of https://github.com/facebook/docusaurus into …
mohamedsgap 63f7ba3
update v-2.0.0-alpha.43 with Travis CI deployment instructions
mohamedsgap 6b53495
Remove updates from v2.0.0-alpha.43
mohamedsgap 509127c
Update deployment.md
yangshun File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -146,3 +146,35 @@ Render offers [free static site hosting](https://render.com/docs/static-sites) w | |
| **Publish Directory** | `build` | | ||
|
||
That's it! Your app will be live on your Render URL as soon as the build finishes. | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove this change. We should just update the newest docs. |
||
## Automating Deployments Using Continuous Integration | ||
|
||
Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the `yarn deploy` script whenever your docs get updated. In the following section, we'll be covering how to do just that using [Travis CI](https://travis-ci.com/), a popular continuous integration service provider. | ||
|
||
|
||
### Using Travis CI | ||
|
||
1. Go to https://github.com/settings/tokens and generate a new [personal access token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/) | ||
1. Using your GitHub account, [add the Travis CI app](https://github.com/marketplace/travis-ci) to the repository you want to activate. | ||
1. Open your Travis CI dashboard. The URL looks like https://travis-ci.com/USERNAME/REPO, and navigate to the `More options` > `Setting` > `Environment Variables` section of your repository. | ||
1. Create a new environment variable named `GH_TOKEN` with your newly generated token as its value, then `GH_EMAIL` (your email address) and `GH_NAME` (your GitHub username). | ||
1. Create a `.travis.yml` on the root of your repository with below text. | ||
|
||
```yaml | ||
# .travis.yml | ||
language: node_js | ||
node_js: | ||
- '8' | ||
branches: | ||
only: | ||
- master | ||
cache: | ||
yarn: true | ||
script: | ||
- git config --global user.name "${GH_NAME}" | ||
- git config --global user.email "${GH_EMAIL}" | ||
- echo "machine github.com login ${GH_NAME} password ${GH_TOKEN}" > ~/.netrc | ||
- yarn && GIT_USER="${GH_NAME}" yarn deploy | ||
``` | ||
|
||
Now, whenever a new commit lands in `master`, Travis CI will run your suite of tests and, if everything passes, your website will be deployed via the `yarn deploy` script. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We support Node 10 and above.