From b62f503ce1a4828184d0bb6a2e28e0284ac11ec0 Mon Sep 17 00:00:00 2001 From: Devin Matte Date: Tue, 28 Mar 2023 22:22:56 -0400 Subject: [PATCH 1/8] Setting up workflow to manually update weekly --- .github/workflows/data-update.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/data-update.yml diff --git a/.github/workflows/data-update.yml b/.github/workflows/data-update.yml new file mode 100644 index 0000000..376db86 --- /dev/null +++ b/.github/workflows/data-update.yml @@ -0,0 +1,28 @@ +name: Update Data +on: + schedule: + - cron: '0 0 * * 7' + push: + branches: + - main + workflow_dispatch: + branches: + - main +jobs: + data-update: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + ref: main + - uses: actions/setup-python@v4 + with: + python-version: '3.9' + - name: Run data update + run: | + make setup-env + make update-data + - name: Create Pull Request + uses: peter-evans/create-pull-request@v4 + with: + branch: update-data From 61ec97bfdae761ef2a48efc2cf8e8d7618a8b62d Mon Sep 17 00:00:00 2001 From: Devin Matte Date: Tue, 28 Mar 2023 22:25:39 -0400 Subject: [PATCH 2/8] Fixing tabbing --- .github/workflows/data-update.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/data-update.yml b/.github/workflows/data-update.yml index 376db86..fc6f6ce 100644 --- a/.github/workflows/data-update.yml +++ b/.github/workflows/data-update.yml @@ -1,7 +1,7 @@ name: Update Data on: schedule: - - cron: '0 0 * * 7' + - cron: '0 0 * * 7' push: branches: - main From 62ae16685fe9ec6769efb6ee2a8719fe3d855eeb Mon Sep 17 00:00:00 2001 From: Devin Matte Date: Tue, 28 Mar 2023 22:26:28 -0400 Subject: [PATCH 3/8] Reformat cron --- .github/workflows/data-update.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/data-update.yml b/.github/workflows/data-update.yml index fc6f6ce..4b66755 100644 --- a/.github/workflows/data-update.yml +++ b/.github/workflows/data-update.yml @@ -1,7 +1,7 @@ name: Update Data on: schedule: - - cron: '0 0 * * 7' + - cron: '0 0 * * 7' push: branches: - main From 78390103177e7e6732739c7ab7ac6423687c986f Mon Sep 17 00:00:00 2001 From: Devin Matte Date: Tue, 28 Mar 2023 22:28:11 -0400 Subject: [PATCH 4/8] Using 0 for sunday --- .github/workflows/data-update.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/data-update.yml b/.github/workflows/data-update.yml index 4b66755..017e015 100644 --- a/.github/workflows/data-update.yml +++ b/.github/workflows/data-update.yml @@ -1,7 +1,7 @@ name: Update Data on: schedule: - - cron: '0 0 * * 7' + - cron: '0 0 * * 0' push: branches: - main From ac5a5982f12a3dd6240fd4669087f109deff7311 Mon Sep 17 00:00:00 2001 From: Devin Matte Date: Tue, 28 Mar 2023 22:30:02 -0400 Subject: [PATCH 5/8] Running on pull requests --- .github/workflows/data-update.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/data-update.yml b/.github/workflows/data-update.yml index 017e015..e3579b3 100644 --- a/.github/workflows/data-update.yml +++ b/.github/workflows/data-update.yml @@ -5,6 +5,8 @@ on: push: branches: - main + pull_request: + types: [opened, reopened] workflow_dispatch: branches: - main From d5f023aa249e4d65ba1621c8184fdcae0402341e Mon Sep 17 00:00:00 2001 From: Devin Matte Date: Tue, 28 Mar 2023 22:31:56 -0400 Subject: [PATCH 6/8] Adding pipenv install --- .github/workflows/data-update.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/data-update.yml b/.github/workflows/data-update.yml index e3579b3..1299f01 100644 --- a/.github/workflows/data-update.yml +++ b/.github/workflows/data-update.yml @@ -20,6 +20,14 @@ jobs: - uses: actions/setup-python@v4 with: python-version: '3.9' + - name: Install pipenv + run: | + python -m pip install --upgrade pipenv wheel + - id: cache-pipenv + uses: actions/cache@v1 + with: + path: ~/.local/share/virtualenvs + key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }} - name: Run data update run: | make setup-env From ee8e28acdbf61dd2a89a21d9ed4f20770a97a7d6 Mon Sep 17 00:00:00 2001 From: Devin Matte Date: Tue, 28 Mar 2023 22:34:10 -0400 Subject: [PATCH 7/8] Trigger on pull request --- .github/workflows/data-update.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/data-update.yml b/.github/workflows/data-update.yml index 1299f01..d54852c 100644 --- a/.github/workflows/data-update.yml +++ b/.github/workflows/data-update.yml @@ -3,13 +3,12 @@ on: schedule: - cron: '0 0 * * 0' push: - branches: - - main + branches: [main] pull_request: + branches: [main] types: [opened, reopened] workflow_dispatch: - branches: - - main + branches: [main] jobs: data-update: runs-on: ubuntu-latest From ddae449b20042e66e2c522d78a6d72e575f03566 Mon Sep 17 00:00:00 2001 From: Devin Matte Date: Tue, 28 Mar 2023 22:34:59 -0400 Subject: [PATCH 8/8] Testing triggers --- .github/workflows/data-update.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/data-update.yml b/.github/workflows/data-update.yml index d54852c..c0a6d5a 100644 --- a/.github/workflows/data-update.yml +++ b/.github/workflows/data-update.yml @@ -3,7 +3,7 @@ on: schedule: - cron: '0 0 * * 0' push: - branches: [main] + branches: [main, automatic-update] pull_request: branches: [main] types: [opened, reopened]