From 050def3adace3ee6bd357995ac58e2104702f24a Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Fri, 6 Sep 2024 13:54:05 -0500 Subject: [PATCH] fix: login after chdir --- sphinx_ape/build.py | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/sphinx_ape/build.py b/sphinx_ape/build.py index 7f4b196..efb94f9 100644 --- a/sphinx_ape/build.py +++ b/sphinx_ape/build.py @@ -117,21 +117,6 @@ def publish(self, repository: str, cicd: bool = False, git_acp: bool = True): raise ApeDocsPublishError(str(err)) from err def _publish(self, repository: str, cicd: bool = False, git_acp=True): - if cicd: - # Must configure the email / username. - git( - "config", - "--local", - "user.email", - "action@github.com", - ) - git( - "config", - "--local", - "user.name", - "GitHub Action", - ) - repo_url = f"https://github.com/{repository}" gh_pages_path = Path.cwd() / "gh-pages" git( @@ -156,6 +141,22 @@ def _publish(self, repository: str, cicd: bool = False, git_acp=True): shutil.copytree(path, gh_pages_path / path.name, dirs_exist_ok=True) os.chdir(str(gh_pages_path)) + + if cicd: + # Must configure the email / username. + git( + "config", + "--local", + "user.email", + "action@github.com", + ) + git( + "config", + "--local", + "user.name", + "GitHub Action", + ) + no_jykell_file = Path(".nojekyll") no_jykell_file.touch(exist_ok=True) if git_acp: