Skip to content

Commit b846851

Browse files
authored
Merge pull request #984 from github/document-npm-run-build
Document npm run build step
2 parents adb4892 + 12f14b7 commit b846851

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

contributing/development.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,24 @@ This site is powered by Node.js! :sparkles: :turtle: :rocket: :sparkles:
88

99
It runs on macOS, Windows, and Linux environments.
1010

11-
You'll need Node.js version 12 or 14 to run the site. To install Node.js, [download the "LTS" installer from nodejs.org](https://nodejs.org). If you're using [`nodenv`](https://github.com/nodenv/nodenv), read the [`nodenv` docs](#nodenv) for instructions on switching Node.js versions.
11+
You'll need Node.js version 12 or 14 to run the site. To install Node.js, [download the "LTS" installer from nodejs.org](https://nodejs.org). If you're using [`nodenv`](https://github.com/nodenv/nodenv), read the [`nodenv` docs](#nodenv) for instructions on switching Node.js versions.
1212

1313
Once you've installed Node.js (which includes the popular `npm` package manager), open Terminal and run the following:
1414

1515
```sh
1616
git clone https://github.com/github/docs
1717
cd docs
1818
npm install
19+
npm run build
1920
npm start
2021
```
2122

2223
You should now have a running server! Visit [localhost:4000](http://localhost:4000) in your browser. It will automatically restart as you make changes to site content.
2324

2425
When you're ready to stop your local server, type <kbd>CTRL</kbd><kbd>c</kbd> in your terminal window.
2526

27+
Note that `npm run build` is a one-time step that create static assets.
28+
2629
## Site structure
2730

2831
This site was originally a Ruby on Rails web application. Some time later it was converted into a static site powered by [Jekyll](https://jekyllrb.com/). A few years after that it was migrated to [Nanoc](https://nanoc.ws/), another Ruby static site generator.

contributing/troubleshooting.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
# Troubleshooting status checks <!-- omit in toc -->
1+
# Troubleshooting <!-- omit in toc -->
22

3+
- [Troubleshooting server tests that fail locally but pass in CI](#troublshooting-server-tests-that-fail-locally-but-pass-in-ci)
34
- [Troubleshooting stalled deployments and CI](#troubleshooting-stalled-deployments-and-ci)
45
- [Staging deployment stalled](#staging-deployment-stalled)
56
- [CI stalled or stuck](#ci-stalled-or-stuck)
@@ -11,7 +12,13 @@
1112
- [Check external links](#check-external-links)
1213
- [Debugging locally](#debugging-locally)
1314

14-
## Troubleshooting stalled deployments and CI
15+
## Troubleshooting
16+
17+
### Troubleshooting server tests that fail locally but pass in CI
18+
19+
If you run the tests locally and get failures in `tests/rendering/server.js` around static assets, stylesheets, and/or the client-side JavaScript bundle, but **the same tests pass in CI** on a PR, you likely need to run `npm run build`. This is a one-time command that creates static assets locally.
20+
21+
See [`development.md`](./development.md) for more info.
1522

1623
### Staging deployment stalled
1724
If a staging deployment is pending for more than 5-10min, try the following:
@@ -107,4 +114,4 @@ During development, you can visit any page on `http://localhost:4000` and add `?
107114
| `permalinks` | Shows all [permalinks](contributing/permalinks.md) that the site is generating for the page.
108115
| `redirect_from` | Shows the hardcoded redirects in the [`redirect_from` frontmatter](content#redirect_from).
109116
| `redirects` | Shows all redirects that the site is generating for the page.
110-
| `includesPlatformSpecificContent` | Shows whether the site detects any [platform-specific content](#operating-system-tags) on the page.
117+
| `includesPlatformSpecificContent` | Shows whether the site detects any [platform-specific content](#operating-system-tags) on the page.

0 commit comments

Comments
 (0)