Skip to content

Commit 1538eb3

Browse files
authored
Merge pull request #5 from datasets/ga-actions
[UP][m] Adding automated github actions
2 parents 6412022 + d705fe6 commit 1538eb3

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

.github/workflows/actions.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Update gini-index datasets
2+
3+
on:
4+
# Schedule to run on each 2 month
5+
schedule:
6+
- cron: '0 0 1 1,3,5,7,9,11 *'
7+
8+
push:
9+
branches:
10+
- main
11+
12+
pull_request:
13+
branches:
14+
- main
15+
16+
workflow_dispatch:
17+
18+
jobs:
19+
build:
20+
runs-on: ubuntu-latest
21+
22+
if: github.ref == 'refs/heads/main'
23+
24+
steps:
25+
- name: Check out repository
26+
uses: actions/checkout@v3
27+
28+
- name: Set up Python 3.12
29+
uses: actions/setup-python@v4
30+
with:
31+
python-version: '3.12'
32+
33+
- name: Run Makefile
34+
run: |
35+
python -m venv venv
36+
source venv/bin/activate
37+
pip install -r scripts/requirements.txt
38+
make
39+
40+
- name: Configure Git
41+
run: |
42+
git config --global user.email "${{ env.CI_COMMIT_EMAIL }}"
43+
git config --global user.name "${{ env.CI_COMMIT_NAME }}"
44+
env:
45+
CI_COMMIT_NAME: "Automated commit"
46+
CI_COMMIT_EMAIL: "actions@users.noreply.github.com"
47+
48+
- name: Commit and Push changes
49+
run: |
50+
git diff --quiet && echo "No changes to commit" || (
51+
git add data/ archive/ &&
52+
git commit -m "${{ env.CI_COMMIT_MESSAGE }}" &&
53+
git push origin main
54+
)
55+
env:
56+
CI_COMMIT_MESSAGE: "Automated commit"

0 commit comments

Comments
 (0)