8000 Squash deployed gh-pages, relying on this repo for history by jni · Pull Request #658 · napari/docs · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Squash deployed gh-pages, relying on this repo for history #658

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

Merged
merged 1 commit into from
Apr 10, 2025

Conversation

jni
Copy link
Member
@jni jni commented Apr 8, 2025

In #621 and elsewhere, we are discussing the issue of autogenerating
screenshots in the docs. @Czaki brought up the issue that git is very
bad at handling binary blobs, so autogenerating images each time we
build the docs would rapidly blow up the repo clone size.

I think it's clear that we do want to autogenerate images, so the
cleanest solution in my opinion is to always squash when pushing to
our gh-pages site (napari.github.io). That history is not particularly
valuable, and indeed we have squashed it once before when it was getting
far too big to work with. Doing it automatically is actually an
improvement.

This PR achieves that by using the force_orphan option in the
peaceiris/actions-gh-pages action to always squash the edit history
before pushing to the gh-pages branch.

References

Zulip discussion:
https://napari.zulipchat.com/#narrow/channel/298358-working-group-documentation/topic/Meeting.202025-03-13.2F14/near/505543160

force_orphan documentation:
https://github.com/peaceiris/actions-gh-pages?tab=readme-ov-file#%EF%B8%8F-force-orphan-force_orphan

@github-actions github-actions bot added the maintenance CI, dependencies, and other maintenance label Apr 8, 2025
Copy link
Contributor
@TimMonko TimMonko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

woohoo! movement towards autogeneration. love it

@jni jni added this to the 0.6.0 milestone Apr 9, 2025
@jni jni merged commit 5fc3cd7 into napari:main Apr 10, 2025
11 checks passed
@jni
Copy link
Member Author
jni commented Apr 10, 2025

@jni jni deleted the squash-docs-deployment branch April 10, 2025 02:07
@psobolewskiPhD
Copy link
Member

💩
https://napari.org gives 404

@psobolewskiPhD
Copy link
Member

@jni looks like this obliterated everything but dev:
https://github.com/napari/napari.github.io/tree/gh-pages

@psobolewskiPhD
Copy link
Member

Looks like force_orphan just uses the latest commit:
https://github.com/peaceiris/actions-gh-pages?tab=readme-ov-file#%EF%B8%8F-force-orphan-force_orphan
so yeah we lose everything else. I think we need to revert this and revert the last commit to gh_pages.

@psobolewskiPhD
Copy link
Member

Sorry that i missed this PR btw. My notifications have been overwhelmed with spam from my own docs fork.

@jni
Copy link
Member Author
jni commented Apr 10, 2025

um. Shit.

@jni
Copy link
Member Author
jni commented Apr 10, 2025

ok, the minimal damage control rn is to redirect napari.org to dev. Let me add that.

@jni
Copy link
Member Author
jni commented Apr 10, 2025

ok I have history locally up to 0.5.4.

@jni
Copy link
Member Author
jni commented Apr 10, 2025

My gif was so appropriate

@psobolewskiPhD
Copy link
Member

Ooof, can't even revert it because history is gone. 😬

@jni
Copy link
Member Author
jni commented Apr 10, 2025

Looks like force_orphan just uses the latest commit:
peaceiris/actions-gh-pages#%EF%B8%8F-force-orphan-force_orphan
so yeah we lose everything else. I think we need to revert this and revert the last commit to gh_pages.

Using the latest commit is what we want if the latest commit contains all the folders, which I thought it did.

Unfortunately this clobbers the whole history so there is no going back. However we may only lose 0.5.5 and 0.5.6 in the worst case. I feel very dumb for not doing git clone before this. 🤦

@jni
Copy link
Member Author
jni commented Apr 10, 2025

ok let me first revert this so we can modify things going forward without them getting clobbered.

jni added a commit to jni/napari-docs that referenced this pull request Apr 10, 2025
@jni
Copy link
Member Author
jni commented Apr 10, 2025

See #663. Could I have a quick merge please? 🙏

@psobolewskiPhD
Copy link
Member

@jni approved, but i'm about to hit the hay -- sorry! 😞

@jni
Copy link
Member Author
jni commented Apr 10, 2025

haha better than last time when I clobbered the history and then myself hit the hay 🤣 Have a good night!

This may save us, will explore now:

https://medium.com/git-tips/githubs-reflog-a9ff21ff765f

@jni
Copy link
Member Author
jni commented Apr 10, 2025

sleep tight! 😂

@TimMonko
Copy link
Contributor

This seems useful -- or is this that backup you mentioned @jni?

It has 0.5.6 though

https://github.com/napari/napari.github.io/tree/gh-pages-backup-2025-04-08

@jni
Copy link
Member Author
jni commented Apr 10, 2025

Oh sweet bejeebus.

https://github.com/napari/napari.github.io/tree/gh-pages-backup-2025-04-08

😂

for the record, I followed the instructions from the medium post, but the curl POST command wouldn't work (probably because of 2FA on my account), but I followed the instructions to the docs and used the GH CLI instructions:

https://docs.github.com/en/rest/git/refs?apiVersion=2022-11-28#create-a-reference

# GitHub CLI api
# https://cli.github.com/manual/gh_api

gh api \
  --method POST \
  -H "Accept: application/vnd.github+json" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  /repos/OWNER/REPO/git/refs \
   -f "ref=refs/heads/featureA" -f "sha=aa218f56b14c9653891f9e74264a383fa43fefbd"

@jni
Copy link
Member Author
jni commented Apr 10, 2025

I just made that right now @TimMonko thanks to the above links 😅 😅 😅

jni added a commit that referenced this pull request Apr 10, 2025
@TimMonko
Copy link
Contributor

Oh wonderful. I am currently cloning it too, just in case. I won't know what to do with it should things go awry but I'm here for you (while fixing my 6th bike flat of the spring gahhh)

@jni
Copy link
Member Author
jni commented Apr 10, 2025

actually, somewhat interestingly, I just saw that the gh-pages deployment action gives you an artifact:

CleanShot 2025-04-10 at 13 26 15@2x

So grabbing from that would have been another option. 😅 Good to know for the future.

https://github.com/napari/napari.github.io/actions/runs/14371590037

Anyway, we are back in business!!!! 😅 Everyone can go back to their normal levels of anxiety now. 😂

@jni
Copy link
Member Author
jni commented Apr 10, 2025

I went a bit too far back on the restore (didn't want to waste time restoring the same commit 😅) so we've lost Tim in the about page. Small price to pay. 😜

No, in seriousness, now that #663 is merged, the very next deploy from here should fix that. 😅

@TimMonko
Copy link
Contributor

Lol I'm such a dingbat I was already using the docs for the past few minutes without realizing it ever went down 🙃
My anxiety was clearly not high enough. I'm over here just chillin

@TimMonko
Copy link
Contributor

The lesson here is that sometimes you have to be the villain in order to become the hero

@melissawm
Copy link
Member

Oh cheese I'm so sorry I missed all the fun here 😆 Just trying to catch up on notifications...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance CI, dependencies, and other maintenance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0