jimporter / mike

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

How to edit a version after it has been deployed? #150

Closed Imzxhir closed 1 year ago

Imzxhir commented 1 year ago

Description: Basically the title, I want to edit a version after it has been deployed and another version has been deloyed. For example, I deploy 5.7.1 as a version and then deploy 5.8.5 as a version, I want to try edit the 5.7.1 version without bringing over the 5.8.5 changes.

jimporter commented 1 year ago

Assuming you tagged 5.7.1 as v5.7.1 in your Git repo:

git checkout v5.7.1
mike deploy 5.7.1

Abstractly, all you need to do is build the correct version of your docs, and then deploy them to the correct directory in your gh-pages branch.

Imzxhir commented 1 year ago

Wait, I didn't really understand. For instance I've got this PR and I want to add it to 5.7.5 rather than the default version 5.8.5, would I edit the github actions file to edit or add anything?

Pull Request: https://github.com/TeamJM/journeymap-docs/pull/31

Github Actions File: https://github.com/TeamJM/journeymap-docs/blob/main/.github/workflows/deploy.yml

jimporter commented 1 year ago

I think the first thing you'll need to do is to make a new Git branch. If you have two parallel versions that you're providing updates for: say 5.8.x (your latest version) plus 5.7.x (the previous "stable" version), then you'll want one Git branch for each. As you keep working on 5.8.x, it will diverge from 5.7.x, so you don't want to merge all this into the same branch.

You'll want to make a branch for 5.7.x in your docs repo, and then when you merge your PR linked above, it should go into that branch, not main. Then everything should just work, so long as each branch knows what version to deploy to (which you can list in your deploy.yml).