-
Notifications
You must be signed in to change notification settings - Fork 3
Add a workflow to build/check/upload docs. #212
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| name: Publish Docs to simoc.space | ||
|
|
||
| on: | ||
| push: | ||
| paths: | ||
| - 'docs/**' | ||
| pull_request: | ||
| paths: | ||
| - 'docs/**' | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| docs: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout Repository | ||
| uses: actions/checkout@v3 | ||
| - name: Install SIMOC Dependencies | ||
| # these are needed for autodoc | ||
| run: | | ||
| python3 -m pip install --upgrade pip | ||
| python3 -m pip install -r requirements.txt | ||
| - name: Install Docs Dependencies | ||
| run: | | ||
| python3 -m pip install sphinx sphinx-rtd-theme sphinx-jsonschema sphinx-lint | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have a
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See also my comment in the other PR. For this workflow it doesn't matter if we install everything globally (including all the Some options include:
Now that I think about it, the last option might be the best one for local installations, even though it's a bit more involved. |
||
| - name: Build Docs | ||
| run: | | ||
| cd docs | ||
| make html | ||
| - name: Check Docs | ||
| run: | | ||
| sphinx-lint --enable default-role docs | ||
| - name: Upload to simoc.space | ||
| # Only upload when the workflow is triggered manually or | ||
| # when a PR that affects docs is merged on master. | ||
| # The always() ensures that this is run even if the | ||
| # sphinx-lint check failed. | ||
| if: ${{ always() && (github.event_name == 'workflow_dispatch' || | ||
| (github.event_name == 'push' && github.ref_name == 'master')) }} | ||
| run: | | ||
| echo 'Uploading docs to simoc.space...' | ||
| ls -l docs/_build/html | ||
| # TODO: upload with SCP | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this catches changes for parts that use
autodoc, because the changes would actually be in e.g.agent_model/agent_model.py. Could just build on every commit? Or maybe have a way to trigger it manually.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point -- if the code is changed but not the doc, this won't be triggered.
I thought about that, but there a few (minor) downsides:
It has a manual trigger already (the
workflow_dispatchbelow), so maybe we can just use that instead?Another option would be to schedule e.g. weekly build, so that even if we forget to deploy manually it will be updated automatically. I have to check if it's possible to combine regular triggers with schedules though.