-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upload the documentation as release assets #3731
Comments
Ping @GenericMappingTools/pygmt-maintainers for comments. |
I just set a branch protection rule for
Step 1-3 is still a lot of work 😅 I do see the value of saving the HTML documentation (or a PDF copy, xref #1606) on GitHub or Zenodo for long term archival. But for restoring the |
We can't disable force pushes, since the doc deploy script always does force pushes: pygmt/.github/workflows/ci_docs.yml Line 199 in e0f8e84
Not that much work since we can use
Good to know that at least we have a copy on DagsHub. Anyway, it does no harm to upload the HTML documentation as a release asset, with a name like |
I've enabled force pushes so that the doc deploy script can update the gh-pages branch. The branch protection rule is still useful for preventing deletion. |
This can be done by the following commands: # Clone the gh-pages branch into a separate directory.
git clone -b gh-pages [email protected]:GenericMappingTools/pygmt.git pygmt-gh-pages
cd pygmt-gh-pages
# Create a directory for storing the zip files
mkdir -p zipfiles
# Loop over versions, create a zip file with names pygmt-<version>-docs.zip
for version in $(ls -1d v0.*); do
echo ${version}
cp -r ${version}/ pygmt-${version}-docs/
zip -r zipfiles/pygmt-${version}-docs.zip pygmt-${version}-docs/
rm -r pygmt-${version}-docs
done The above commands create zip files with name Then we can upload them as release assets using the command below (not tested yet): for version in $(ls -1d v0.*); do
gh release upload $version zipfiles/pygmt-${version}-docs.zip
done Please let me know if you have any comments before I take actions. |
After thinking twice, maybe we should just name the zip files like Then the commands will be:
and
|
The PyGMT documentation is hosted in the
gh-pages
branch, with docs of each PyGMT release stored in subdirectories, and docs of the main branch in thedev
subdirectory.Currently, the documentation has no backups and we may lose all the documentation in some rare cases, e.g.,
Technically speaking, we can restore the PyGMT documentation since,
I think the easiest solution is to upload the documentation of each release as release assets. Then if we lose the documentation, we just need to:
Looking at the current gh-pages branch, there are more files/directories in addition to the version subdirectories, so the above steps are not enough to restore the gh-pages branch. Here are the additional files/directories:
.buildinfo
: This file was added 6 years ago. At that time, files were pushed to the root directory instead of subdirectories in the gh-pages branch. In other words, this file should be deleted..nojekyll
: Tell GitHub to not build this branch using Jekyll [Automatically created by the workflow]CNAME
: Set up the docs domain (xref: https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/troubleshooting-custom-domains-and-github-pages#cname-errors) [It was manually added and maintained. I think we should create it automatically in the workflow]index.html
: The index page, redirected to/latest/
automatically [Again, this file should be automatically created in the workflow]latest
: Symlink to the latest release [Automatically linked to the latest version only when making a release. So it's likely we have to create the symblink manually, but it's technically possible to determine the latest version usinggh release list
command]dev
: Contains the dev docs [Automatically created by the workflow]It agreed, here are things we need to do:
.buildinfo
file Delete the .buildinfo file from gh-pages branch #3748.nojekyll
/CNAME
/index.html
are created automatically CI: Update the doc deploy script to generate CNAME and index.html #3749latest
symlink created automaticallyThe text was updated successfully, but these errors were encountered: