MapServer / MapServer-documentation

Source repository for the MapServer documentation, for the live website. Please submit pull requests to the 'main' branch.
https://mapserver.org
Other
34 stars 69 forks source link

Clean repository when all languages are rebuilt #966

Open geographika opened 3 weeks ago

geographika commented 3 weeks ago

When docs are built and pushed to https://github.com/MapServer/mapserver.github.io/ old HTML files are never removed.

There are several published pages which have been removed from https://github.com/MapServer/MapServer-documentation/ that are still online. For example:

This pull request adds a step to delete all the files from the https://github.com/MapServer/mapserver.github.io/ repo if a pull request includes [build_translations] in the commit message. This tag is already used to trigger rebuilds of all languages.

We can only remove all files when rebuilding all languages, otherwise when building just en all the language subfolders (ar, fr etc.) would be removed.

I've tested this on my own forks - see https://github.com/geographika/MapServer-documentation/actions Note the uk and zh_cn folders are removed completely (they haven't been build for several years):

https://github.com/MapServer/mapserver.github.io/tree/master/uk https://github.com/MapServer/mapserver.github.io/tree/master/zh_cn

The cleaned repository goes from 1.2 GB and 32,141 files to 810 MB and 28,979 files. You can compare before and after the clean-up by looking at https://github.com/MapServer/mapserver.github.io/ and https://github.com/geographika/mapserver.github.io

The only files not generated by Sphinx README.md and .nojekyll are restored after the repo is cleaned.