Skip to content

Commit

Permalink
Merge pull request #177 from nrabinowitz/publish-website-script
Browse files Browse the repository at this point in the history
Add publish-website script
  • Loading branch information
nrabinowitz committed Jan 8, 2019
2 parents fac1bae + b657142 commit f844901
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 15 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,12 @@ else()
)
endif()

# Website publishing
add_custom_target(publish-website
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/scripts/publish_website.sh
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)

# Link all executables against H3
macro(add_h3_executable name)
# invoke built-in add_executable
Expand Down
3 changes: 3 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
2. Create a release "Release X.Y.Z" on Github
* Create Tag `vX.Y.Z`
* Copy CHANGELOG.md into the release notes

3. Publish the website to display the latest docs
* `make publish-website`
29 changes: 29 additions & 0 deletions scripts/publish_website.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/sh
# Copyright 2019 Uber Technologies, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# This script builds the current version of the H3 documentation website
# and pushes it to production. This assumes that you have set the remote
# for gh-pages to the upstream (i.e. uber/h3) remote.

git checkout gh-pages
git pull
git checkout master
pushd website
./scripts/build-to-gh-pages.sh
git push
git checkout master
popd


17 changes: 2 additions & 15 deletions website/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,8 @@ npm start

## Updating the H3 Website

From `./website`:
Make sure your `gh-pages` branch has its remote set to the upstream repo, then

Make sure your `gh-pages` branch is up to date with the upstream repo:
```
git checkout gh-pages
git pull upstream gh-pages
```

Switch back to `master` and run the build:
```
git checkout master
./scripts/build-to-gh-pages.sh
```

You're now on branch `gh-pages` again. Push changes to the live site:
```
git push upstream gh-pages:gh-pages
make publish-website
```

0 comments on commit f844901

Please sign in to comment.