Skip to content
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

Remote repo ? #87

Closed
RRadziejewski opened this issue Feb 1, 2022 · 3 comments
Closed

Remote repo ? #87

RRadziejewski opened this issue Feb 1, 2022 · 3 comments

Comments

@RRadziejewski
Copy link

I am trying to deploy using mike from one repository to another.
Is that even possible ? Or mike does allow only to work within one repo and branches in it.
I run it like that:

  - mike deploy --rebase --prefix public --config-file ./docs/mkdocs.yml -r $HTTPS_REMOTE -p -b $PAGES_BRANCH 1.6.0
  - mike set-default --rebase --prefix public --config-file ./docs/mkdocs.yml -r $HTTPS_REMOTE -p -b $PAGES_BRANCH 1.6.0

I always end up with this error on deploy:

error: failed to push some refs to 'https://gitlab.internal.com/gentoo/dococo.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details."
@RRadziejewski
Copy link
Author

RRadziejewski commented Feb 1, 2022

Fought force push will be helpfull but it's not

@jimporter
Copy link
Owner

You need to run mike within the repository where you want the generated docs to go. However, it should (mostly) work if you use --config-file to point to an mkdocs.yml that doesn't live in that repo. The commit SHA reference in the commit message will be wrong, but that's not a major problem (though this does mean that when running mike deploy, it needs to be able to find a commit SHA for the active branch in the target repo).

That said, this isn't how mike is intended to work, since it's mainly for generating docs to host on Github, which wants the generated docs to live in the same repo. You can use it with other forges, but, as the discussion in #25 indicates, Gitlab doesn't think about generated docs in the same way and so there are some sharp corners. For non-Github cases, I think I'd recommend something like ReadTheDocs instead.

@RRadziejewski
Copy link
Author

Sorry forgot to add: i solved the issue i just cloned the repo. to which I want to add and I run mike from within that repo specifying path to mkdocs.yml via --config-file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants