-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make versioning of docs with mike optional in action (#361)
- Loading branch information
Showing
2 changed files
with
16 additions
and
10 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 |
---|---|---|
@@ -1,22 +1,30 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
git config --global --add safe.directory /github/workspace | ||
|
||
echo "Building docs" | ||
mkdocs_simple_gen --config-file ${INPUT_CONFIG:-'mkdocs.yml'} | ||
mkdocs build | ||
|
||
git config --global user.name "${GITHUB_ACTOR}" | ||
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" | ||
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 | ||
|
||
if [ ${INPUT_PUSH} ]; then | ||
mike deploy -p -u -b ${INPUT_PUBLISH_BRANCH} ${INPUT_VERSION} | ||
echo "Deploying ${INPUT_VERSION} to ${INPUT_PUBLISH_BRANCH}" | ||
if [ "${INPUT_VERSION}" ]; then | ||
echo "Deploying ${INPUT_VERSION} to ${INPUT_PUBLISH_BRANCH}" | ||
mike deploy -p -u -b ${INPUT_PUBLISH_BRANCH} ${INPUT_VERSION} | ||
else | ||
echo "Deploying docs to ${INPUT_PUBLISH_BRANCH}" | ||
mkdocs gh-deploy -b ${INPUT_PUBLISH_BRANCH} | ||
fi | ||
|
||
if [ ${INPUT_DEFAULT_VERSION} ]; then | ||
mike set-default -p -b ${INPUT_PUBLISH_BRANCH} ${INPUT_DEFAULT_VERSION} | ||
if [ "${INPUT_DEFAULT_VERSION}" ]; then | ||
echo "Setting default version to ${INPUT_DEFAULT_VERSION}" | ||
mike set-default -p -b ${INPUT_PUBLISH_BRANCH} ${INPUT_DEFAULT_VERSION} | ||
|
||
fi | ||
fi |