Skip to content

Commit

Permalink
Fix deploy script
Browse files Browse the repository at this point in the history
- Do Yarn install before webpack build
- Exit on error
  • Loading branch information
mjackson committed Sep 30, 2019
1 parent 34667d8 commit e4e44ae
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions scripts/deploy-website.sh
@@ -1,5 +1,7 @@
#!/bin/bash

set -e

PUBLIC_PATH="${PUBLIC_PATH:-/react-router/}"

root_dir="$(dirname "$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)")"
Expand All @@ -12,16 +14,17 @@ git clone --depth 2 --branch master "git@github.com:ReactTraining/reacttraining.
# Build the website into the static/react-router dir
rm -rf "$tmp_dir/static/react-router"
cd "$root_dir/website"
yarn build -- --output-path "$tmp_dir/static/react-router" --output-public-path $PUBLIC_PATH
yarn
yarn build --output-path "$tmp_dir/static/react-router" --output-public-path $PUBLIC_PATH

# Commit all changes
cd $tmp_dir
git add -A
git commit \
--author "Travis CI <travis-ci@reacttraining.com>" \
-m "Update react-router website
https://travis-ci.org/$TRAVIS_REPO_SLUG/builds/$TRAVIS_BUILD_ID" \
--author "Travis CI <travis@reacttraining.com>"
https://travis-ci.org/$TRAVIS_REPO_SLUG/builds/$TRAVIS_BUILD_ID"

# Deploy
git push origin master

0 comments on commit e4e44ae

Please sign in to comment.