Skip to content

Commit

Permalink
ci: build docs for tagged commits (googleapis#2089)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenplusplus authored Mar 15, 2017
1 parent f8dde3e commit 13978a9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
6 changes: 6 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
deployment:
release:
tag: /.+/
owner: GoogleCloudPlatform
commands:
- ./scripts/circle/post-test.sh
17 changes: 15 additions & 2 deletions scripts/circle/post-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,28 @@

set -e

if [ "${CIRCLE_BRANCH}" != "master" ] && [ "${CI_PULL_REQUEST}" != "" ]
if [ "${CIRCLE_BRANCH}" != "master" ] &&
[ "${CI_PULL_REQUEST}" != "" ] &&
[ "${CIRCLE_TAG}" == "" ]
then
# Not a push to master, so no doc updates required.
exit 0
fi

# For a tagged build, we will build the docs for the associated module.
# Otherwise, it will build for master.
export TAGGED_MODULE_NAME=${CIRCLE_TAG/-*}
export TAGGED_MODULE_VERSION=${CIRCLE_TAG/*-}

if [ "${CIRCLE_TAG:0:1}" == "v" ]
then
export TAGGED_MODULE_NAME="google-cloud"
export TAGGED_MODULE_VERSION=${CIRCLE_TAG:1}
fi

set +e # allows `git` commands during prepare-ghpages to fail

npm run prepare-ghpages
npm run prepare-ghpages $TAGGED_MODULE_NAME $TAGGED_MODULE_VERSION

cd gh-pages
git fetch origin
Expand Down

0 comments on commit 13978a9

Please sign in to comment.