From 00f145bef0cfcdefe3915f4decfb492e18ec6f90 Mon Sep 17 00:00:00 2001 From: Stefanie Molin <24376333+stefmolin@users.noreply.github.com> Date: Sun, 2 Apr 2023 18:02:23 -0400 Subject: [PATCH 01/10] Add doc build action. --- .github/workflows/docs.yml | 48 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000..41fa44a4 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,48 @@ +name: Deploy Docs + +on: + push: + branches: [ "main" ] + + # just for testing now + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + build: + name: Build and deploy docs. + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - uses: actions/setup-python@v4 + with: + python-version: "3.x" + + - name: Install dependencies + run: | + pip install '.[docs]' + + - name: git config + run: | + git config user.email "Stefanie Molin" + git config user.name "24376333+stefmolin@users.noreply.github.com" + + - name: Sphinx build + run: | + cd docs + make html + + - name: Deploy docs + run: | + cd docs/_build/html + git add --all + git commit -m "Update documentation." + git push origin gh-pages From 01a2d998221f864e135cd3b902abadb42ee97ca7 Mon Sep 17 00:00:00 2001 From: Stefanie Molin <24376333+stefmolin@users.noreply.github.com> Date: Sun, 2 Apr 2023 18:06:04 -0400 Subject: [PATCH 02/10] Add missing worktree line. --- .github/workflows/docs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 41fa44a4..6ceecf32 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -37,6 +37,7 @@ jobs: - name: Sphinx build run: | + git worktree add docs/_build/html gh-pages cd docs make html From fb158ded699e364d6543edf10dca49ef278d340a Mon Sep 17 00:00:00 2001 From: Stefanie Molin <24376333+stefmolin@users.noreply.github.com> Date: Sun, 2 Apr 2023 18:20:46 -0400 Subject: [PATCH 03/10] Give write permission. --- .github/workflows/docs.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 6ceecf32..4d9e9a69 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -16,6 +16,8 @@ jobs: name: Build and deploy docs. runs-on: ubuntu-latest + permissions: + contents: write steps: - uses: actions/checkout@v3 From 15fd2a80b76f3cd75abdd6dc95f2b26fb0d85a02 Mon Sep 17 00:00:00 2001 From: Stefanie Molin <24376333+stefmolin@users.noreply.github.com> Date: Sun, 2 Apr 2023 18:21:05 -0400 Subject: [PATCH 04/10] Update labeler for doc build action. --- .github/labeler.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/labeler.yml b/.github/labeler.yml index 044c84d5..e4a3c8e9 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -15,6 +15,7 @@ data: - src/data_morph/data/**/* documentation: +- '.github/workflows/docs.yml' - docs/**/* - README.rst From 99a4787e56d3a9fb0c578c3a60db78c9acf03c8d Mon Sep 17 00:00:00 2001 From: Stefanie Molin <24376333+stefmolin@users.noreply.github.com> Date: Sun, 2 Apr 2023 18:27:36 -0400 Subject: [PATCH 05/10] Remove git config step to test. --- .github/workflows/docs.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 4d9e9a69..9d2937a1 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -32,11 +32,6 @@ jobs: run: | pip install '.[docs]' - - name: git config - run: | - git config user.email "Stefanie Molin" - git config user.name "24376333+stefmolin@users.noreply.github.com" - - name: Sphinx build run: | git worktree add docs/_build/html gh-pages From 5661b7a9e9918713a7bd5735b348c30c6095d053 Mon Sep 17 00:00:00 2001 From: Stefanie Molin <24376333+stefmolin@users.noreply.github.com> Date: Sun, 2 Apr 2023 18:31:02 -0400 Subject: [PATCH 06/10] Update docs action. --- .github/labeler.yml | 2 +- .github/workflows/docs.yml | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index e4a3c8e9..db06ffd9 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -15,7 +15,7 @@ data: - src/data_morph/data/**/* documentation: -- '.github/workflows/docs.yml' +- .github/workflows/docs.yml - docs/**/* - README.rst diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 9d2937a1..4d9e9a69 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -32,6 +32,11 @@ jobs: run: | pip install '.[docs]' + - name: git config + run: | + git config user.email "Stefanie Molin" + git config user.name "24376333+stefmolin@users.noreply.github.com" + - name: Sphinx build run: | git worktree add docs/_build/html gh-pages From cb0761eb479f9d9b99b2539665ea7efe72e01026 Mon Sep 17 00:00:00 2001 From: Stefanie Molin <24376333+stefmolin@users.noreply.github.com> Date: Sun, 2 Apr 2023 18:40:59 -0400 Subject: [PATCH 07/10] Don't run doc build action on PRs; only merges into main. --- .github/workflows/docs.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 4d9e9a69..5efae10a 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,12 +1,15 @@ +# This workflow builds the Data Morph documentation and publishes it using GitHub pages. +# +# Based on https://olgarithms.github.io/sphinx-tutorial/docs/8-automating-documentation-updates.html +# +# Author: Stefanie Molin + name: Deploy Docs on: push: branches: [ "main" ] - # just for testing now - pull_request: - concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true From 9882a110f69c16de6ac4a46326fdfb6c4f218b38 Mon Sep 17 00:00:00 2001 From: Stefanie Molin <24376333+stefmolin@users.noreply.github.com> Date: Sun, 2 Apr 2023 18:47:01 -0400 Subject: [PATCH 08/10] Add any grouping to label action. --- .github/labeler.yml | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index db06ffd9..f826f8e0 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -2,31 +2,35 @@ bounds: - src/data_morph/bounds/**/* ci/cd: -- '.coveragerc' -- '.github/**/*' -- '.pre-commit-config.yaml' -- setup.cfg +- any: + - '.coveragerc' + - '.github/**/*' + - '.pre-commit-config.yaml' + - setup.cfg cli: -- src/data_morph/__main__.py -- src/data_morph/cli.py +- any: + - src/data_morph/__main__.py + - src/data_morph/cli.py data: - src/data_morph/data/**/* documentation: -- .github/workflows/docs.yml -- docs/**/* -- README.rst +- any: + - .github/workflows/docs.yml + - docs/**/* + - README.rst morpher: - src/data_morph/morpher.py packaging: -- pyproject.toml -- README.rst -- LICENSE -- src/data_morph/__init__.py +- any: + - pyproject.toml + - README.rst + - LICENSE + - src/data_morph/__init__.py plotting: - src/data_morph/plotting/**/* From 5b3840790d548dedfdb55c240584ebebf733dcd2 Mon Sep 17 00:00:00 2001 From: Stefanie Molin <24376333+stefmolin@users.noreply.github.com> Date: Sun, 2 Apr 2023 18:50:13 -0400 Subject: [PATCH 09/10] Debugging labeler. [skip ci] --- .github/labeler.yml | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index f826f8e0..4e1ff1e4 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -2,35 +2,30 @@ bounds: - src/data_morph/bounds/**/* ci/cd: -- any: - - '.coveragerc' - - '.github/**/*' - - '.pre-commit-config.yaml' - - setup.cfg +- '.coveragerc' +- '.pre-commit-config.yaml' +- setup.cfg cli: -- any: - - src/data_morph/__main__.py - - src/data_morph/cli.py +- src/data_morph/__main__.py +- src/data_morph/cli.py data: - src/data_morph/data/**/* documentation: -- any: - - .github/workflows/docs.yml - - docs/**/* - - README.rst +- .github/workflows/docs.yml +- docs/**/* +- README.rst morpher: - src/data_morph/morpher.py packaging: -- any: - - pyproject.toml - - README.rst - - LICENSE - - src/data_morph/__init__.py +- pyproject.toml +- README.rst +- LICENSE +- src/data_morph/__init__.py plotting: - src/data_morph/plotting/**/* From a1b4eaf98cc6739f75f63f46be0571ae4661432e Mon Sep 17 00:00:00 2001 From: Stefanie Molin <24376333+stefmolin@users.noreply.github.com> Date: Sun, 2 Apr 2023 18:53:11 -0400 Subject: [PATCH 10/10] Debugging labeler. [skip ci] --- .github/labeler.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index 4e1ff1e4..e4a3c8e9 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -3,6 +3,7 @@ bounds: ci/cd: - '.coveragerc' +- '.github/**/*' - '.pre-commit-config.yaml' - setup.cfg @@ -14,7 +15,7 @@ data: - src/data_morph/data/**/* documentation: -- .github/workflows/docs.yml +- '.github/workflows/docs.yml' - docs/**/* - README.rst