Skip to content
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

Push docs to GitHub Pages using Actions #198

Merged
merged 16 commits into from
Jul 30, 2020
Merged

Push docs to GitHub Pages using Actions #198

merged 16 commits into from
Jul 30, 2020

Conversation

leouieda
Copy link
Member

Replaces our custom TravisCI script with GitHub Actions for pushing the built documentation to the gh-pages branch.

Reminders:

  • Run make format and make check to make sure the code follows the style guide.
  • Add tests for new features or tests that would have caught the bug that you're fixing.
  • Add new public functions/methods/classes to doc/api/index.rst and the base __init__.py file for the package.
  • Write detailed docstrings for all functions/classes/methods. It often helps to design better code if you write the docstrings first.
  • If adding new functionality, add an example to the docstring, gallery, and/or tutorials.
  • Add your full name, affiliation, and ORCID (optional) to the AUTHORS.md file (if you haven't already) in case you'd like to be listed as an author on the Zenodo archive of the next release.

@leouieda
Copy link
Member Author

Download the built docs from the test workflow doesn't work because we can't share artefacts between workflows, only between jobs in the same workflow. So we either build the docs again or move the docs deployment to the test workflow (which is not great since there is no easy way to rerun it without running all the tests).

@leouieda
Copy link
Member Author

leouieda commented Jul 28, 2020

TODO:

  • Remove the current branch from on:
  • Remove the GHPAGE_BRANCH variable from the checkout and push commands
  • Uncomment the PyPI deploy
  • Remove TravisCI configuration

@leouieda
Copy link
Member Author

@dopplershift @hugovk this should do it for deploying to Github Pages producing the same output as we had before with Travis. @dopplershift I copied most of that script from MetPy so this might be useful if you haven't migrated this part already.

I couldn't use the artefacts from the testing workflow because Actions doesn't support it. Instead of deploying from the test workflow I'm building the docs again here and then pushing them. It's not ideal but it's what works for now. I was trying to use https://github.com/peaceiris/actions-gh-pages but I couldn't make it reset the latest link. In the end, I just copied our previous shell script into the workflow. The checkout action actually sets the github token so you can push without extra configuration (which is nice but also alarming).

I tested by deploying to this branch: https://github.com/fatiando/pooch/commits/gh-pages-test I made a few dev pushes which did amend the existing commit and "tag" push that did what it was supposed to do.

@dopplershift
Copy link
Contributor

I saw this and marked it as something I want to come and "learn from". Bummer that you couldn't get one of the actions to work. I might have to ponder a PR/issue to one that makes sense because I'd love not to handle that machinery (not that ours has changed in years).

What you've got here seems reasonable to me.

@leouieda
Copy link
Member Author

I might have to ponder a PR/issue to one that makes sense because I'd love not to handle that machinery (not that ours has changed in years).

I’m considering this as well. I haven’t the slightest clue how these things work though. But what would be required is the ability to run a given bash script/command inside the checked out repository. It feels like setting the latest link is a bit too niche?

At least having the code here can serve as a guide for what we need from the Action. But as you said, this code hasn’t changed in years.

Copy link
Member

@hugovk hugovk left a comment

Choose a reason for hiding this comment

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

Looks good!

Remove travis configuration. Don't build on this branch. Uncomment PyPI
deploy. Fix pushing to gh-pages branch.
@leouieda leouieda changed the title WIP Push docs to GitHub Pages using Actions Push docs to GitHub Pages using Actions Jul 29, 2020
@leouieda leouieda removed the request for review from dopplershift July 29, 2020 13:28
@leouieda leouieda changed the title Push docs to GitHub Pages using Actions WIP Push docs to GitHub Pages using Actions Jul 29, 2020
@leouieda leouieda changed the title WIP Push docs to GitHub Pages using Actions Push docs to GitHub Pages using Actions Jul 30, 2020
@leouieda leouieda merged commit cd183ec into master Jul 30, 2020
@leouieda leouieda deleted the deploy-docs branch July 30, 2020 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants