From 8573666d7ab7796dae8d0b18a497f841dd59d0de Mon Sep 17 00:00:00 2001 From: Florian Rupprecht <33600480+nx10@users.noreply.github.com> Date: Mon, 7 Aug 2023 13:04:21 -0400 Subject: [PATCH] Docs workflow auto detect module name (#24) * Docs workflow auto detect module name * Gh pages instructions in readme --- .github/workflows/docs.yml | 3 ++- README.md | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 649e787..62004e7 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -26,7 +26,8 @@ jobs: poetry install -E docs - name: Build docs run: | - poetry run pdoc src/APP_NAME -o docs_build -t docs/pdoc-theme --docformat google + APP_MODULE_NAME=$(ls src -U | head -1) # Get the first module name in the src directory + poetry run pdoc src/"$APP_MODULE_NAME" -o docs_build -t docs/pdoc-theme --docformat google touch docs_build/.nojekyll - uses: JamesIves/github-pages-deploy-action@v4 with: diff --git a/README.md b/README.md index c4bf2c5..47b154b 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ This is a template repository. Below is a checklist of things you should do to u - [ ] Update the name of `src/APP_NAME` - [ ] Grant third-party app permissions (e.g. Codecov) [here](https://github.com/organizations/cmi-dair/settings/installations), if necessary. - [ ] Either generate a `CODECOV_TOKEN` secret [here](https://github.com/cmi-dair/flowdump/blob/main/.github/workflows/python_tests.yaml) (if its a private repository) or remove the line `token: ${{ secrets.CODECOV_TOKEN }}` +- [ ] API docs website: After the first successful build, go to the `Settings` tab of your repository, scroll down to the `GitHub Pages` section, and select `gh-pages` as the source. This will generate a link to your API docs. # Project name