File tree Expand file tree Collapse file tree 1 file changed +65
-0
lines changed
Expand file tree Collapse file tree 1 file changed +65
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Update cash-surplus-deficit data
2+
3+ on :
4+ # Schedule to run on the 1st day of each month
5+ schedule :
6+ - cron : ' 0 0 1 * *'
7+
8+ # Run on push to main branch
9+ push :
10+ branches :
11+ - main
12+
13+ # Run on pull requests targeting the main branch
14+ pull_request :
15+ branches :
16+ - main
17+
18+ # Allows manual triggering of the workflow
19+ workflow_dispatch :
20+
21+ jobs :
22+ build :
23+ runs-on : ubuntu-latest
24+
25+ if : github.ref == 'refs/heads/main'
26+
27+ steps :
28+ - name : Check out repository
29+ uses : actions/checkout@v3
30+
31+ - name : Set up Python 3.12
32+ uses : actions/setup-python@v4
33+ with :
34+ python-version : ' 3.12'
35+
36+ - name : Install Python dependencies
37+ run : |
38+ python -m venv venv
39+ source venv/bin/activate
40+ pip install --upgrade pip
41+ pip install -r scripts/requirements.txt
42+
43+ - name : Run scripts
44+ run : |
45+ source venv/bin/activate
46+ cd scripts
47+ python process.py
48+
49+ - name : Configure Git
50+ run : |
51+ git config --global user.email "${{ env.CI_COMMIT_EMAIL }}"
52+ git config --global user.name "${{ env.CI_COMMIT_NAME }}"
53+ env :
54+ CI_COMMIT_NAME : " Automated commit"
55+ CI_COMMIT_EMAIL : " actions@users.noreply.github.com"
56+
57+ - name : Commit and Push changes
58+ run : |
59+ git diff --quiet && echo "No changes to commit" || (
60+ git add data datapackage.json archive &&
61+ git commit -m "${{ env.CI_COMMIT_MESSAGE }}" &&
62+ git push origin main
63+ )
64+ env :
65+ CI_COMMIT_MESSAGE : " Automated commit"
You can’t perform that action at this time.
0 commit comments