From b3abe844b0ba2b0e60cb4e1501c11c772ab78f8e Mon Sep 17 00:00:00 2001 From: Sai Ram Kiran <76441268+sairamkiran9@users.noreply.github.com> Date: Sun, 16 Jan 2022 21:39:17 +0530 Subject: [PATCH 1/6] added git auto commit workflow --- .github/workflows/python-app.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 6203503..0b38ae2 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -33,3 +33,11 @@ jobs: - name: Test with pytest run: | tox + - name: execute python script + run: | + python ./docs/source/generate_style_list.py + - name: commit files + run: | + git config user.name "$(git log -n 1 --pretty=format:%an)" + git config user.email "$(git log -n 1 --pretty=format:%ae)" + git diff-index --quiet HEAD || (git commit -a -m '[bot] update files' --allow-empty && git push -f) \ No newline at end of file From 47b77e2aafa301c3d4550e58b129a6434a031be7 Mon Sep 17 00:00:00 2001 From: Sai Ram Kiran <76441268+sairamkiran9@users.noreply.github.com> Date: Tue, 18 Jan 2022 21:50:01 +0530 Subject: [PATCH 2/6] aligned as per suggestions --- .github/workflows/python-app.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 0b38ae2..673c630 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -38,6 +38,7 @@ jobs: python ./docs/source/generate_style_list.py - name: commit files run: | - git config user.name "$(git log -n 1 --pretty=format:%an)" - git config user.email "$(git log -n 1 --pretty=format:%ae)" - git diff-index --quiet HEAD || (git commit -a -m '[bot] update files' --allow-empty && git push -f) \ No newline at end of file + git config --local user.name "github-actions" + git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" + git diff --quiet && git diff --staged --quiet || git commit -a -m 'docs: update style list' + git push From 1d7dec87e8e2597909f91b377fb6ef66edf6b223 Mon Sep 17 00:00:00 2001 From: Sai Ram Kiran <76441268+sairamkiran9@users.noreply.github.com> Date: Wed, 19 Jan 2022 09:50:54 +0530 Subject: [PATCH 3/6] added pip install table2ascii --- .github/workflows/python-app.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 673c630..e766374 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -35,6 +35,7 @@ jobs: tox - name: execute python script run: | + pip install -U table2ascii python ./docs/source/generate_style_list.py - name: commit files run: | From a798ab84aa9d58286cb84043011c7027f07d6c34 Mon Sep 17 00:00:00 2001 From: Sai Ram Kiran <76441268+sairamkiran9@users.noreply.github.com> Date: Wed, 19 Jan 2022 22:37:25 +0530 Subject: [PATCH 4/6] updated as per the suggestions --- .github/workflows/python-app.yml | 1 - docs/source/generate_style_list.py | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index e766374..673c630 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -35,7 +35,6 @@ jobs: tox - name: execute python script run: | - pip install -U table2ascii python ./docs/source/generate_style_list.py - name: commit files run: | diff --git a/docs/source/generate_style_list.py b/docs/source/generate_style_list.py index 6f258ce..0d1d59d 100644 --- a/docs/source/generate_style_list.py +++ b/docs/source/generate_style_list.py @@ -1,4 +1,5 @@ import os +__import__("sys").path.append(os.path.join(os.path.dirname(__file__), "..", "..")) from table2ascii import PresetStyle, table2ascii From 222026e9702aee989f53560ef744dbe23accc43b Mon Sep 17 00:00:00 2001 From: Sai Ram Kiran <76441268+sairamkiran9@users.noreply.github.com> Date: Fri, 21 Jan 2022 23:51:04 +0530 Subject: [PATCH 5/6] added workflow to update docs on push to main --- .github/workflows/python-app.yml | 9 ------- .github/workflows/python-update-docs.yml | 34 ++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/python-update-docs.yml diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 673c630..6203503 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -33,12 +33,3 @@ jobs: - name: Test with pytest run: | tox - - name: execute python script - run: | - python ./docs/source/generate_style_list.py - - name: commit files - run: | - git config --local user.name "github-actions" - git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" - git diff --quiet && git diff --staged --quiet || git commit -a -m 'docs: update style list' - git push diff --git a/.github/workflows/python-update-docs.yml b/.github/workflows/python-update-docs.yml new file mode 100644 index 0000000..1b52242 --- /dev/null +++ b/.github/workflows/python-update-docs.yml @@ -0,0 +1,34 @@ +# This workflow will install Python dependencies, executes generate_style_list script and update docs during workkflow +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Update docs + +on: + workflow_dispatch: + push: + branches: + - main + +jobs: + docs: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.8] + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install --upgrade --upgrade-strategy eager --no-cache-dir .[docs] + - name: execute script + run: | + python ./docs/source/generate_style_list.py + - uses: EndBug/add-and-commit@v8 + with: + default_author: github_actions + message: 'docs: update style list' \ No newline at end of file From 97bbc1ea77201c840c93ec6f2c7d83523d4e06f8 Mon Sep 17 00:00:00 2001 From: Sai Ram Kiran <76441268+sairamkiran9@users.noreply.github.com> Date: Fri, 21 Jan 2022 23:58:48 +0530 Subject: [PATCH 6/6] added newline at end --- .github/workflows/python-update-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-update-docs.yml b/.github/workflows/python-update-docs.yml index 1b52242..b2fbd3b 100644 --- a/.github/workflows/python-update-docs.yml +++ b/.github/workflows/python-update-docs.yml @@ -31,4 +31,4 @@ jobs: - uses: EndBug/add-and-commit@v8 with: default_author: github_actions - message: 'docs: update style list' \ No newline at end of file + message: 'docs: update style list'