Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,10 @@ node_js:
- "12"

before_script:
- mkdir -p "${TRAVIS_BUILD_DIR}"/build
- CHANGED_FILES=$(git diff --name-only HEAD~1...HEAD .)
- |
if echo $CHANGED_FILES | grep "package.json"
then
cp package.json "${TRAVIS_BUILD_DIR}"/build
fi
- BOOK_BUILD_DIR="${TRAVIS_BUILD_DIR}"/_book

script:
- |
if echo $CHANGED_FILES | grep "package.json"
then
npm build --reload . ${TRAVIS_BUILD_DIR}/build
else
npm build . ${TRAVIS_BUILD_DIR}/build
fi
- npm run build

after_success:
- |
Expand Down
7 changes: 3 additions & 4 deletions tools/deploy/update_site_travis.bash
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,13 @@ git config user.email "[email protected]"

GH_REPO_REF="github.com/${DOCS_REPO_OWNER}/${DOCS_REPO_NAME}.git"

# Assume the book has already been built, and was moved to `build/`
# inside the same directory as this script.
# Assume the book has already been built and lives in $BOOK_BUILD_DIR.

if [ -d build ]; then
if [ -d "${BOOK_BUILD_DIR}" ]; then
echo "${bold}Cloning the website repo...${normal}"
git clone -b "${DOCS_BRANCH_NAME}" https://git@"${GH_REPO_REF}"
rm -rf ./"${DOCS_REPO_NAME}"/*
cp -a ./build/* ./"${DOCS_REPO_NAME}"
cp -a "${BOOK_BUILD_DIR}"/* ./"${DOCS_REPO_NAME}"
pushd ./"${DOCS_REPO_NAME}"
echo "www.algorithm-archive.org" > CNAME
echo "${bold}Adding changes...${normal}"
Expand Down