jimporter / mike

Manage multiple versions of your MkDocs-powered documentation via Git
BSD 3-Clause "New" or "Revised" License
551 stars 47 forks source link

Remote repo ? #87

Closed RRadziejewski closed 2 years ago

RRadziejewski commented 2 years ago

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 commented 2 years ago

Fought force push will be helpfull but it's not

jimporter commented 2 years ago

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 commented 2 years ago

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.