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
4 changes: 4 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ jobs:
- checkout
- run: git submodule update --init
- run: docs/build.sh
- add_ssh_keys:
fingerprints:
- "a2:f7:59:f0:01:8b:91:31:ab:0c:3f:9f:25:4c:1e:e5"
- run: docs/publish.sh
- store_artifacts:
path: generated/docs

Expand Down
43 changes: 43 additions & 0 deletions docs/publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/bash

# This is run on every commit that CircleCI picks up. It assumes that docs have already been built
# via docs/build.sh. The push behavior differs depending on the nature of the commit:
# * Tag commit (e.g. v1.6.0): pushes docs to versioned location.
# * Master commit: pushes docs to latest.
# * Otherwise: noop.

set -e

DOCS_DIR=generated/docs
CHECKOUT_DIR=../envoy-mobile-docs
BUILD_SHA=`git rev-parse HEAD`

if [ -n "$CIRCLE_TAG" ]
then
PUBLISH_DIR="$CHECKOUT_DIR"/docs/envoy-mobile/"$CIRCLE_TAG"
elif [ -z "$CIRCLE_PULL_REQUEST" ] && [ "$CIRCLE_BRANCH" == "master" ]
then
PUBLISH_DIR="$CHECKOUT_DIR"/docs/envoy-mobile/latest
else
echo "Ignoring docs push"
exit 0
fi

echo 'cloning'
git clone git@github.com:envoy-mobile/envoy-mobile.github.io "$CHECKOUT_DIR"

git -C "$CHECKOUT_DIR" fetch
git -C "$CHECKOUT_DIR" checkout -B master origin/master
rm -fr "$PUBLISH_DIR"
mkdir -p "$PUBLISH_DIR"
cp -r "$DOCS_DIR"/* "$PUBLISH_DIR"
cd "$CHECKOUT_DIR"

git config user.name "envoy-mobile-docs(ci)"
git config user.email envoy-mobile-docs@users.noreply.github.com
echo 'add'
git add .
echo 'commit'
git commit -m "docs envoy-mobile@$BUILD_SHA"
echo 'push'
git push origin master
2 changes: 1 addition & 1 deletion envoy
Submodule envoy updated 128 files