Skip to content
This repository was archived by the owner on Apr 10, 2023. It is now read-only.

Generation of new docs via Github Actions#130

Open
vyrzdev wants to merge 27 commits intorossmacarthur:masterfrom
vyrzdev:master
Open

Generation of new docs via Github Actions#130
vyrzdev wants to merge 27 commits intorossmacarthur:masterfrom
vyrzdev:master

Conversation

@vyrzdev
Copy link
Contributor

@vyrzdev vyrzdev commented Feb 10, 2021

This should work great, although I'd like to hear your input on how I'm overwriting the existing branch completely.
Theres a little bit of hackiness when I include the library in the PYTHONPATH env variable to get it to import properly in conf.py.

Currently the workflow is:

  • Generate Docs
  • Copy generated docs into a swap folder
  • Checkout into gh-pages branch
  • Delete all existing files on the branch <-- I am unsure if this is what you want.
  • Copy in newly generated docs from the swap folder
  • Add all changes
  • Commit, but hide the exit code if no changes are made overall.
  • Push

Ben Parsons-Willis added 27 commits February 10, 2021 16:02
- When installing through pip, no sphinx-build command was installed
- I think it was importing the pip installed serde package from your pip install library, now imports the local library from the directory

- Caveat: Now just docs must be run from the project root.
@rossmacarthur
Copy link
Owner

Hey @vyrzdev 👋, thanks for the PR.

I'll share some of my thoughts as to how this can be improved:

Since sphinx builds the docs to docs/_build/html I think you should use @actions/checkout to checkout the repo on the gh-pages branch at that path (so there will be two checkouts in the workflow). Then you can run just docs which will update the data in docs/_build/html. Then you can add and commit that data, for this you can probably use something like @stefanzweifel/git-auto-commit-action with the repository value set to docs/_build/html.

@@ -0,0 +1,36 @@
# Triggers the workflows on push or pull request events but only for the main branch
name: Generate new docs.
Copy link
Owner

Choose a reason for hiding this comment

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

I would prefer if this was just docs. Same with the file name.

Comment on lines +18 to +19
with:
ref: master
Copy link
Owner

@rossmacarthur rossmacarthur Feb 15, 2021

Choose a reason for hiding this comment

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

Not sure I understand why this is here 🤔. I think it would be assumed that the docs would be built from the branch running the workflow not always from master.

cp -r ../html_docs_swap_folder/* ./
git add .
git diff-index --quiet HEAD || git commit -m "publish docs for $(git -C ../../.. rev-parse --short HEAD)"
git push No newline at end of file
Copy link
Owner

Choose a reason for hiding this comment

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

See my comment on the PR about using an action for this

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants