-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(site): migrate documentation to Docsy
update circleci config
- Loading branch information
1 parent
1861db0
commit 2952571
Showing
55 changed files
with
4,635 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "site/themes/docsy"] | ||
path = site/themes/docsy | ||
url = https://github.com/google/docsy.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright 2019-2020 StreamThoughts. | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
last_commit="$(git diff --name-status HEAD~1 site | cat | grep 'site/')" | ||
|
||
HUGO_BUILD_DIR=$(pwd)/docs/ | ||
HUGO_SOURCE_DIR=$(pwd)/site/ | ||
HUGO_VERSION=0.60.1 | ||
HUGO_DIST_DIR=/tmp/hugo/v${HUGO_VERSION} | ||
HUGO_RELEASE=https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_Linux-64bit.tar.gz | ||
|
||
# backup Git user info | ||
GIT_USER_NAME=$(git config user.name) | ||
GIT_USER_EMAIL=$(git config user.email) | ||
|
||
|
||
build_and_deploy(){ | ||
echo "Buildind Hugo site" | ||
rm -rf docs/* | ||
rm $HUGO_DIST_DIR && mkdir -p $HUGO_DIST_DIR | ||
git config --global user.email circleci@circleci | ||
git config --global user.name CircleCI | ||
# update hugo theme submodule | ||
git submodule sync && git submodule update --init --recursive | ||
# install hugo and build | ||
wget $HUGO_RELEASE -P $HUGO_DIST_DIR && \ | ||
(cd $HUGO_DIST_DIR; tar -xzvf $HUGO_DIST_DIR/hugo_extended_${HUGO_VERSION}_Linux-64bit.tar.gz) && \ | ||
(cd $HUGO_SOURCE_DIR; sudo npm install) && \ | ||
HUGO_ENV=production $HUGO_DIST_DIR/hugo -v -s $HUGO_SOURCE_DIR -d $HUGO_BUILD_DIR | ||
if [[ $? -eq 0 ]]; then | ||
echo "Deploying site updates" | ||
git add docs | ||
git commit -m "docs(gh-pages): build and deploy site [skip ci]" | ||
git push | ||
else | ||
echo "Hugo build failed" | ||
fi | ||
# reset git config | ||
git config --global user.email $GIT_USER_EMAIL | ||
git config --global user.name $GIT_USER_NAME | ||
exit $? | ||
} | ||
|
||
if [ $# -eq 1 ]; then | ||
case $1 in | ||
--force) | ||
build_and_deploy | ||
;; | ||
*) | ||
echo "Unknown arg $1" | ||
;; | ||
esac | ||
fi | ||
|
||
if [[ ${last_commit} ]]; then | ||
build_and_deploy | ||
else | ||
echo "Skipping site building, lastest commit message doesn't change path directory 'site/'" | ||
fi | ||
|
||
exit 0 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
.btn { | ||
display: inline-flex; | ||
align-items: center; | ||
border: none; | ||
border-radius: 4px; | ||
color: #ffffff; | ||
font-size: 16px; | ||
font-weight: bold; | ||
letter-spacing: 1.06px; | ||
text-align: center; | ||
text-transform: uppercase; | ||
width: 186px; | ||
height: 52px; | ||
cursor: pointer; | ||
justify-content: center; | ||
padding-left: 0.8em; | ||
padding-right: 0.8em; | ||
|
||
&-github { | ||
background-color: transparent; | ||
border: solid 1px #ffffff; | ||
color: #ffffff !important ; | ||
} | ||
} |
Oops, something went wrong.