Skip to content

Commit

Permalink
Add a BUILD_ONLY deploy mode
Browse files Browse the repository at this point in the history
Summary:
This allows running `BUILD_ONLY=true ./deploy.sh` to generate a static,
dependency-free version of the site without actually deploying to the
GitHub Pages site.

Test Plan:
Run `BUILD_ONLY=true ./deploy.sh`. Inspect the temporary directory that
it emits; make sure that the site is fully usable without an Internet
connection. Note that the deploy script does not actually deploy.
  • Loading branch information
wchargin committed Nov 10, 2016
1 parent 1b58a77 commit 0d5b214
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ set -e
# Disable this if you've already run 'npm build'.
: "${BUILD:=true}"

# Set this to "true" if you just want to save the contents to a
# standalone application without deploying to the site.
: "${BUILD_ONLY:=false}"

# Explode the contents of this directory,
# and the stage the following enclosed files and folders.
EXPLODE=dist
Expand Down Expand Up @@ -79,6 +83,13 @@ else
fi
cp -r "$EXPLODE"/* "$TMPDIR"

if [[ "$BUILD_ONLY" == "true" ]]; then
printf 'BUILD_ONLY is set; stopping here.\n'
printf 'Contents available in: %s\n' "$TMPDIR"
exit 0
fi


git checkout gh-pages
cp -r "$TMPDIR"/* .
git add "${STAGE[@]}"
Expand Down

0 comments on commit 0d5b214

Please sign in to comment.