From 3c43fa1065bc849bd61c1637edadf1f05270138b Mon Sep 17 00:00:00 2001 From: gradedSystem Date: Tue, 22 Oct 2024 14:44:51 +0700 Subject: [PATCH 1/3] [add][m] Early update Github Actions --- .github/workflows/actions.yml | 61 +++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/actions.yml diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml new file mode 100644 index 0000000..e878787 --- /dev/null +++ b/.github/workflows/actions.yml @@ -0,0 +1,61 @@ +name: Update population dataset + +on: + # Schedule to run on the 1st January each year + schedule: + - cron: '0 0 1 1 *' + + push: + branches: + - main + + pull_request: + branches: + - main + + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + if: github.ref == 'refs/heads/main' + + steps: + - name: Check out repository + uses: actions/checkout@v3 + + - name: Set up Python 3.12 + uses: actions/setup-python@v4 + with: + python-version: '3.12' + + - name: Install dependencies + run: | + python -m venv venv + source venv/bin/activate + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Run shell script + run: | + source venv/bin/activate + python scripts/process.py + + - name: Configure Git + run: | + git config --global user.email "${{ env.CI_COMMIT_EMAIL }}" + git config --global user.name "${{ env.CI_COMMIT_NAME }}" + env: + CI_COMMIT_NAME: "Automated commit" + CI_COMMIT_EMAIL: "actions@users.noreply.github.com" + + - name: Commit and Push changes + run: | + git diff --quiet && echo "No changes to commit" || ( + git add . && + git commit -m "${{ env.CI_COMMIT_MESSAGE }}" && + git push origin main + ) + env: + CI_COMMIT_MESSAGE: "Automated commit" \ No newline at end of file From 0aea8cb0838a85befa93ce41a8ffb30fae5dafa9 Mon Sep 17 00:00:00 2001 From: gradedSystem Date: Tue, 22 Oct 2024 14:46:56 +0700 Subject: [PATCH 2/3] [fix][s] quarterly cron job --- .github/workflows/actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index e878787..5121e62 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -3,7 +3,7 @@ name: Update population dataset on: # Schedule to run on the 1st January each year schedule: - - cron: '0 0 1 1 *' + - cron: '0 0 1 1,4,7,10 *' push: branches: From 6b65fb5600854c480b5a927439adaf93618bff25 Mon Sep 17 00:00:00 2001 From: Yedige Ashmet <55581804+gradedSystem@users.noreply.github.com> Date: Tue, 22 Oct 2024 13:22:42 +0500 Subject: [PATCH 3/3] [fix][s] Changing the add path --- .github/workflows/actions.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 5121e62..d2ca7b5 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -53,9 +53,9 @@ jobs: - name: Commit and Push changes run: | git diff --quiet && echo "No changes to commit" || ( - git add . && + git add data && git commit -m "${{ env.CI_COMMIT_MESSAGE }}" && git push origin main ) env: - CI_COMMIT_MESSAGE: "Automated commit" \ No newline at end of file + CI_COMMIT_MESSAGE: "Automated commit"