Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -56,4 +60,5 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CUSTOM_DOMAIN: optionaldomain.com
CONFIG_FILE: folder/mkdocs.yml
REQUIREMENTS: folder/requirements.txt
```
11 changes: 3 additions & 8 deletions action.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down