Skip to content

Commit

Permalink
Revert "Pip install via another sub-action"
Browse files Browse the repository at this point in the history
This reverts commit bd8bfa8.
  • Loading branch information
guyer committed May 17, 2023
1 parent f5359df commit 605fd52
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 8 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ RUN pip install packaging
RUN pip install github-action-utils

ADD entrypoint.py /entrypoint.py
ADD entrypoint.sh /entrypoint.sh
ADD ntd2d_action /ntd2d_action

ENTRYPOINT ["/entrypoint.py"]
ENTRYPOINT ["/entrypoint.sh"]
13 changes: 6 additions & 7 deletions entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ def main():
action = os.environ['INPUT_ACTION']
docs = SphinxDocs(docs_dir=os.environ['INPUT_DOCS-FOLDER'])

# # Install any requirements for documentation.
# # Adapted from ammaraskar/sphinx-action
# requirements = os.path.join(docs.docs_dir, "requirements.txt")
# if os.path.exists(requirements):
# subprocess.check_call(["pip", "install", "-r", requirements])

if action == 'update_pages':
repo = Repository(server_url=os.environ['GITHUB_SERVER_URL'],
repository=os.environ['GITHUB_REPOSITORY'],
Expand All @@ -22,13 +28,6 @@ def main():
sha=os.environ['GITHUB_SHA'])
elif action == 'borg_the_docs':
docs.assimilate_theme()
elif action == 'pip_requirements':
# Install any requirements for documentation.
# Adapted from ammaraskar/sphinx-action
requirements = docs.docs_dir / "requirements.txt"
if os.path.exists(requirements):
subprocess.check_call(["pip", "install", "-r", requirements.as_posix()])


if __name__ == "__main__":
main()
21 changes: 21 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh

echo "::error::`env`"
echo "::warning::INPUT_ACTION=${INPUT_ACTION}"
echo "::warning::GITHUB_SHA=${GITHUB_SHA}"
echo "::warning::INPUT_DOCS-FOLDER=${INPUT_DOCS-FOLDER}"
echo "::warning::INPUT_DEFAULT-BRANCH=${INPUT_DEFAULT-BRANCH}"
echo "::warning::INPUT_PAGES-BRANCH=${INPUT_PAGES-BRANCH}"
echo "::warning::INPUT_PAGES-URL=${INPUT_PAGES-URL}"

requirements="${INPUT_DOCS-FOLDER}/requirements.txt"

echo "::error::requirements=${requirements}"
if [ -f $requirements ];
then
echo "::notice::installing"
pip install -r $requirements
echo "::notice::`python -m pip freeze`"
fi

python /entrypoint.py >> $GITHUB_OUTPUT

0 comments on commit 605fd52

Please sign in to comment.