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

GitHub Pages Build and Deployment Action Triggered Twice, but One Fails. #224

Closed srikant-ch5 closed 3 months ago

srikant-ch5 commented 3 months ago

Summary

Our requirement is to deploy documentation changes with versioning both at https://orgname.github.io/canvas/v13 and at a URL that does not include the version number, specifically /latest (https://orgname.github.io/canvas/).

To achieve this in the GitHub workflow for deploying docs, we are utilizing mkdocs and mike commands as shown below:

- run: mkdocs gh-deploy --force - run: mike deploy --push --update-aliases v13 latest

As a consequence of this setup, two GitHub Actions for page build and deployment are being triggered simultaneously.

Screenshot 2024-07-23 at 12 36 25 PM

Could you please suggest a more optimal way to execute mike commands so that we can avoid the above issue?

Configuration and Logs

Screenshot 2024-07-23 at 12 46 39 PM
jimporter commented 3 months ago

I don't think mkdocs gh-deploy and mike deploy are likely to play nicely with each other. I think the former will wipe out any existing versioned docs you've previously deployed. You might be able to get this to work with some effort, but I think the best way forward is to not worry about it. If you want a stable URL for the latest version of your documentation, that's what aliases are there for.

You might be able to get something like what you want with a sufficiently-advanced 404.html page (redirect unversioned paths to the default version?), but I'm not 100% sure that would work out...