Skip to content

Commit

Permalink
fix: login after chdir
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Sep 6, 2024
1 parent 8737761 commit 050def3
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions sphinx_ape/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
"[email protected]",
)
git(
"config",
"--local",
"user.name",
"GitHub Action",
)

repo_url = f"https://github.com/{repository}"
gh_pages_path = Path.cwd() / "gh-pages"
git(
Expand All @@ -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",
"[email protected]",
)
git(
"config",
"--local",
"user.name",
"GitHub Action",
)

no_jykell_file = Path(".nojekyll")
no_jykell_file.touch(exist_ok=True)
if git_acp:
Expand Down

0 comments on commit 050def3

Please sign in to comment.