Skip to content

deploy via gh-pages #353

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 2 commits into from
Aug 18, 2020
Merged

deploy via gh-pages #353

merged 2 commits into from
Aug 18, 2020

Conversation

mattip
Copy link
Member

@mattip mattip commented Aug 12, 2020

replaces #289

This is based on the assumption that we still want a deploy workflow based on a local repo, not automated via CI.

The Makefile now has grown a few more options. The normal workflow would be make clean; make html; make serve, look at the local version or commit the changes and look at them via netlify. When a PR is merged to master, git checkout master; git pull; make serve, look one more time, then make deploy. The pages will be put into a gh-pages branch and served via github pages from that branch.

Additionally, if you want to work on a fork, you can do all of the above with
make TARGET=myname BASEURL=https://myname.github.io/numpy.org <command>
which will deploy the pages to your fork, like this. It does take ~5 minutes for the pages to redeploy, so netlify may be a better preview mechanism. But sometimes you don't want to keep pushing little changes to this repo before squashing and opening a PR.

make help works and should show helpful text

Copy link
Member

@rgommers rgommers left a comment

Choose a reason for hiding this comment

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

Thanks Matti, this works pretty well modulo the two small issues I commented on.

@rgommers
Copy link
Member

This is based on the assumption that we still want a deploy workflow based on a local repo, not automated via CI.

Yep that's fine for now, we can change it later if needed.

In it goes, thanks Matti!

@rgommers rgommers merged commit 18545ab into numpy:master Aug 18, 2020
@rgommers rgommers mentioned this pull request Aug 30, 2020
@rgommers
Copy link
Member

rgommers commented Aug 30, 2020

Thanks Matti, this works pretty well modulo the two small issues I commented on.

Just in case, to avoid confusion when looking at this later: I actually tested this on a different Hugo site - never used it for numpy.org.

Okay I changed my mind here. It's not worth messing with Cloudflare DNS to move to gh-pages. Serving from https://github.com/numpy/numpy.github.com has worked fine and is actually the nicer solution (keeps this repo light), so I'll look at adapting the NumPy devdocs deploy method.

@rgommers
Copy link
Member

rgommers commented Sep 14, 2020

This is really hacky, but until the above is done, use:

hugo
cd public
# Note: ensure the numpy.github.com repo is up-to-date!
cp -R . ../../tmp/numpy.github.com/
cd ../../tmp/numpy.github.com/
git status  # if new files were added, `git add` those
git commit -a -m "Deploy latest changes"
git push origin master

@mattip
Copy link
Member Author

mattip commented Sep 15, 2020

until the above is done

Is there something actionable that I can help with?

@rgommers
Copy link
Member

@mattip, thanks for asking - yes there is. Copying over the exact deploy method we use for the numpy devdocs to this repo, so we can deploy to the numpy.github.com repo.

@rgommers rgommers mentioned this pull request Oct 8, 2020
@mattip
Copy link
Member Author

mattip commented Dec 21, 2020

@rgommers if you want to deploy from the gh-pages branch, I think all you need to do is move the CNAME file from numpy.github.com to this repo. Then you could use this gitub actions workflow to build and deploy.

@rgommers
Copy link
Member

@joelachance looking into this, I think he identified the same GitHub Action. There's also Cloudflare settings to mess with, and it'd be nice to keep a couple of commits on the gh-pages branch so in case something goes wrong a deploy is easy to revert and debug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants