Skip to content

Commit

Permalink
Add colors to the output
Browse files Browse the repository at this point in the history
  • Loading branch information
athackst committed Aug 5, 2022
1 parent b6f0db5 commit 2206478
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions docker/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,30 +1,35 @@
#!/bin/bash

set -e
UNSET='\033[0m'
RED='\033[00;31m'
GREEN='\033[00;32m'
YELLOW='\033[00;33m'
CYAN='\033[00;36m'


git config --global --add safe.directory /github/workspace

echo "Building docs"
echo -e "${CYAN}Building docs${UNSET}"
mkdocs_simple_gen --config-file ${INPUT_CONFIG:-'mkdocs.yml'}
mkdocs build

if [ "${INPUT_PUSH}" ]; then
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"

git fetch origin ${INPUT_PUBLISH_BRANCH} --depth=1
git fetch origin ${INPUT_PUBLISH_BRANCH} --depth=1 || echo -e "${YELLOW}skipping fetch${UNSET}"

if [ "${INPUT_VERSION}" ]; then
echo "Deploying ${INPUT_VERSION} to ${INPUT_PUBLISH_BRANCH}"
echo -e "${CYAN}Deploying ${INPUT_VERSION} to ${INPUT_PUBLISH_BRANCH}${UNSET}"
mike deploy -p -u -b ${INPUT_PUBLISH_BRANCH} ${INPUT_VERSION}
else
echo "Deploying docs to ${INPUT_PUBLISH_BRANCH}"
echo "${CYAN}Deploying docs to ${INPUT_PUBLISH_BRANCH}${UNSET}"
mkdocs gh-deploy -b ${INPUT_PUBLISH_BRANCH}
fi

if [ "${INPUT_DEFAULT_VERSION}" ]; then
echo "Setting default version to ${INPUT_DEFAULT_VERSION}"
echo -e "${CYAN}Setting default version to ${INPUT_DEFAULT_VERSION}${UNSET}"
mike set-default -p -b ${INPUT_PUBLISH_BRANCH} ${INPUT_DEFAULT_VERSION}

fi
fi

0 comments on commit 2206478

Please sign in to comment.