Skip to content

Commit

Permalink
add config option for custom location of mkdocs config yml (#37)
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Hausenblas <hausenbl@amazon.com>
  • Loading branch information
geoffcline committed Sep 30, 2020
1 parent fda3630 commit 64753ba
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions action.sh
Expand Up @@ -20,10 +20,16 @@ if [ -n "${CUSTOM_DOMAIN}" ]; then
echo "${CUSTOM_DOMAIN}" > "${GITHUB_WORKSPACE}/docs/CNAME"
fi

if [ -n "${CONFIG_FILE}" ]; then
print_info "Setting custom path for mkdocs config yml"
export CONFIG_FILE="${GITHUB_WORKSPACE}/${CONFIG_FILE}"
else
export CONFIG_FILE="${GITHUB_WORKSPACE}/mkdocs.yml"
fi

if [ -n "${GITHUB_TOKEN}" ]; then
print_info "setup with GITHUB_TOKEN"
remote_repo="https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"

elif [ -n "${PERSONAL_TOKEN}" ]; then
print_info "setup with PERSONAL_TOKEN"
remote_repo="https://x-access-token:${PERSONAL_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
Expand All @@ -40,4 +46,4 @@ fi
git remote rm origin
git remote add origin "${remote_repo}"

mkdocs gh-deploy --config-file "${GITHUB_WORKSPACE}/mkdocs.yml" --force
mkdocs gh-deploy --config-file "${CONFIG_FILE}" --force

0 comments on commit 64753ba

Please sign in to comment.