diff --git a/Dockerfile b/Dockerfile index 836226b..5b9a7c7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.9.6-alpine +FROM python:3.9.6-buster LABEL version="1.0.0" LABEL repository="https://github.com/totaldebug/sphinx-publish-action" @@ -6,10 +6,11 @@ LABEL homepage="https://github.com/totaldebug/sphinx-publish-action" LABEL maintainer="Steven Marks " # debug -RUN apk add --no-cache git build-base -RUN apk add --update curl +RUN apt update -y +RUN apt upgrade -y +RUN apt install curl git -y -RUN pip install -U sphinx +RUN pip install -U sphinx poetry RUN sphinx-build --version COPY LICENSE README.rst / diff --git a/entrypoint.sh b/entrypoint.sh index 14962ec..11d6e50 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -106,8 +106,8 @@ if [ "${INPUT_KEEP_HISTORY}" = true ]; then COMMIT_OPTIONS="--allow-empty" else echo "::debug::Initializing new repo" - LOCAL_BRANCH="main" - git init -b $LOCAL_BRANCH + LOCAL_BRANCH="master" + git init PUSH_OPTIONS="--force" COMMIT_OPTIONS="" fi @@ -116,6 +116,19 @@ echo "::debug::Local branch is ${LOCAL_BRANCH}" cd "${GITHUB_WORKSPACE}" +echo "::debug::Checking for requirements file in ${GITHUB_WORKSPACE}/requirements.txt" +if [ -f "${GITHUB_WORKSPACE}/requirements.txt" ]; then + echo "::debug::Installing Project requirements" + pip install -r ${GITHUB_WORKSPACE}/requirements.txt +fi + +echo "::debug::Checking for poetry file in ${GITHUB_WORKSPACE}/pyproject.toml" +if [ -f "${GITHUB_WORKSPACE}/pyproject.toml" ]; then + echo "::debug::Installing Poetry Project requirements" + poetry build -f wheel + pip install dist/*.whl +fi + echo "::debug::Checking for requirements file in ${SPHINX_SRC}/requirements.txt" if [ -f "${SPHINX_SRC}/requirements.txt" ]; then echo "::debug::Installing Sphinx requirements"