server icon indicating copy to clipboard operation
server copied to clipboard

🔨 Wiki workflow & cleanup

Open zach2good opened this issue 3 years ago • 7 comments

  • [x] I have paid attention to this example and will edit again if need be to not break the formatting, or I will be ignored
  • [x] I have searched existing issues to see if the issue has already been opened, and I have checked the commit log to see if the issue has been resolved since my server was last updated
  • [x] I have read and understood the Contributing Guide

Describe the feature

The actual wiki

https://github.com/LandSandBoat/server.wiki.git

Workable mirror of the wiki

https://github.com/LandSandBoat/lsb-wiki.git

Setup

# Clone and use the lsb-wiki workable wiki repo
git clone [email protected]:LandSandBoat/lsb-wiki.git
cd lsb-wiki

# Add the published viewable wiki repo as a remote
git remote add wiki https://github.com/LandSandBoat/server.wiki.git    

Publishing

Once you have changes in lsb-wiki that you want to publish to the viewable wiki (this could one day be done automatically by CI)

# Force-push your local main branch to lsb-wiki main to make sure everything remains up-to-date
git push --force origin main

# Force-push your local main branch onto the published wiki'd master branch (this is the visible branch)
git push --force wiki main:master

It would be really nice to LOCK the main wiki from being modified (which is not a big deal, since only core contributors can modify it now) and force people to go through the workflow of submitting PRs to lsb-wiki.

If we guaranteed that the actual wiki repo wasn't being modified, we could setup a github action to do the above setup steps and publish changes automatically.

zach2good avatar Jul 26 '22 07:07 zach2good

Other items:

  • Move any images used in pages into the repo, away from githubusercontent and other external links
  • Remove [] and() from any filenames, and make all the filenames consistant
  • Get rid of whatever .mediawiki is and replace with regular markdown
  • Go through all the pages and make sure they're all sane, valid and clean markdown

zach2good avatar Jul 26 '22 07:07 zach2good

More:

  • Add a README.md to the wiki repo, explaining that issues should be raised on the main repo, with a link
  • CI linting to make sure that additions are valid markdown

Content:

  • Go through all the startup guides and make sure they're still valid

zach2good avatar Jul 26 '22 07:07 zach2good

Even more:

  • Since it doesn't seem to use a folder structure (who knows?), we should bake the section names into each file:
    • something-something-ffmath.md -> Developer-something-something-ffmath.md

zach2good avatar Jul 26 '22 07:07 zach2good

Provide instructions for how to go to the wiki repo and press . to get to the nice web editor, and get to a layout where editing markdown is super easy: image

zach2good avatar Jul 26 '22 07:07 zach2good

For reference, GH uses Gollum: https://github.com/gollum/gollum https://github.com/gollum/gollum/wiki

zach2good avatar Jul 26 '22 07:07 zach2good

Guess who learned something real shitty
GitHub wiki's branch to show is `master`
They missed it in their big refactor a year or two ago to use `main`

zach2good avatar Jul 26 '22 08:07 zach2good

I had some time on my lunchbreak to figure out how to do the syncing between repos:

(all on my forks)

server wiki: https://github.com/zach2good/server/wiki writable wiki: https://github.com/zach2good/lsb-wiki CI script: https://github.com/zach2good/lsb-wiki/blob/main/.github/workflows/publish.yml Successful CI run: https://github.com/zach2good/lsb-wiki/runs/7518435835?check_suite_focus=true

Prep:

  • Generate an SSH key, with the target repo's name in the comment (not sure if the comment is needed): ssh-keygen -t ed25519 -C "[email protected]:zach2good/server.git"
  • Add the public key to the target repo as a Deploy Key
  • Add the private key as a secret to the pushing repo, in this case named TEST_GITHUB (matches ssh-private-key: ${{ secrets.TEST_GITHUB }} in the CI script)
  • Push changes to lsb-wiki, see them propagates to the viewable wiki a few moments later

zach2good avatar Jul 26 '22 10:07 zach2good

We have a nice CI job that publishes the wiki from our mirror when merges happen - I think this is in a good place

zach2good avatar Sep 19 '23 10:09 zach2good