From 41a776793a516ffa045058c581fb9d1453cbe384 Mon Sep 17 00:00:00 2001 From: Frinze Erin Lapuz <44391389+frinzekt@users.noreply.github.com> Date: Sat, 5 Dec 2020 23:42:53 +0800 Subject: [PATCH 1/2] Make installation of requirements.txt optional --- action.sh | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/action.sh b/action.sh index 30a6460..0080b0a 100644 --- a/action.sh +++ b/action.sh @@ -6,14 +6,9 @@ function print_info() { echo -e "\e[36mINFO: ${1}\e[m" } -if [ -n "${REQUIREMENTS}" ] && [ -f "${GITHUB_WORKSPACE}/${REQUIREMENTS}" ]; then - pip install -r "${GITHUB_WORKSPACE}/${REQUIREMENTS}" -else - REQUIREMENTS="${GITHUB_WORKSPACE}/requirements.txt" - if [ -f "${REQUIREMENTS}" ]; then - pip install -r "${REQUIREMENTS}" - fi -fi +if [ -f "${GITHUB_WORKSPACE}/${REQUIREMENTS}" ]; then + pip install -r "${GITHUB_WORKSPACE}/${REQUIREMENTS}" +fi if [ -n "${CUSTOM_DOMAIN}" ]; then print_info "Setting custom domain for github pages" From bb2d4d34e07bc92151387f0507c43ed2fb69e17c Mon Sep 17 00:00:00 2001 From: Frinze Erin Lapuz <44391389+frinzekt@users.noreply.github.com> Date: Sat, 5 Dec 2020 23:47:08 +0800 Subject: [PATCH 2/2] documentation for requirements.txt installation --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 34982f1..7d4fc2b 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,10 @@ https://www.mkdocs.org/user-guide/deploying-your-docs/#custom-domains This action supports deployment of mkdocs with different file path , if you populate a `CONFIG_FILE` environment variable. This is important if you have mkdocs file in another folder such as if you have `mkdocs.yml` in a path `docs/mkdocs.yml`. Without populating this, the deployment assumes that `mkdocs.yml` is on the root folder. +### Requirements.txt + +This action supports installation of `requirements.txt` for custom installations on the mkdocs package such as installation of mermaid markdown which is not present as part of the mkdocs base extensions. If you populate a `REQUIREMENTS` environment variable with a path, the action will install the file being pointed by the environment variable. + ## Example usage ```shell @@ -56,4 +60,5 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} CUSTOM_DOMAIN: optionaldomain.com CONFIG_FILE: folder/mkdocs.yml + REQUIREMENTS: folder/requirements.txt ```