-
Notifications
You must be signed in to change notification settings - Fork 337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use git worktree in deploy_local #1221
Conversation
This avoids the need to determine the remote url, as we can reuse the existing one in the checked out repository. This also allows us to use deploy_local in GitHub Actions
I now export The other benefit to this approach using An example workflow file using the changes in this PR is at https://github.com/jimhester/r-actions-test/actions/runs/38247939/workflow#L27-L31 |
We need to double check that these changes don't break |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now just needs a news bullet, I think.
d66a367
to
0c328e2
Compare
Ok added two news bullets about the new function and deprecating the |
|
||
github_clone(dest_dir, repo_slug, host) | ||
git("fetch", "origin", branch) | ||
github_worktree_add(dest_dir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may be completely wrong here but shouldn't this be:
github_worktree_add(dest_dir, branch = branch)
?
We're getting an error when trying to deploy from travis with the dev version of pkgdown:
Error in git("worktree", "add", "--track", "-b", branch, dir, paste0("origin/", :
argument "branch" is missing, with no default
Complete log: https://travis-ci.org/rmaia/pavo/jobs/651466810
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change now throws the following error when travis tries to deploy on enterprise github
Running git worktree add --track -b gh-pages /tmp/Rtmp8zQQdq/file598365058050
origin/gh-pages
Preparing worktree (new branch 'gh-pages')
error: the requested upstream branch 'origin/gh-pages' does not exist
...
...
...
Error: System command 'git' failed, exit status: 255, stdout & stderr were printed
Btw, gh-pages
branch does exist on our repos.
A mistake introduced after refactoring Fixes a78e04c Fixes #1221 (review)
This avoids the need to determine the remote url, as we can reuse the
existing one in the checked out repository.
This also allows us to use
deploy_local()
in GitHub Actions