-
Notifications
You must be signed in to change notification settings - Fork 1
executable file
·57 lines (53 loc) · 2.08 KB
/
run-data-pipeline.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Run-Data-Pipeline
on:
push:
branches-ignore:
- "master"
jobs:
run-pipeline:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install data pipeline
run: |
sudo apt install python3.10
python3.10 -m pip install setuptools
python3.10 -m pip install git+https://github.com/ddionrails/paneldata_pipeline@master#egg=paneldata_pipeline
- name: Process Data
run: |
python3.10 -m paneldata_pipeline -i metadata/ -o ddionrails/ -s gip -w ${{ secrets.study_version }} -u
- name: Install data compliance check
run: |
python3 -m pip install setuptools
python3 -m pip install goodtables
- name: Test Structure
run: |
python3 -m goodtables validate --skip-checks extra-header ddionrails/datapackage.json
- name: Update file and push to remote
run: |
echo "Stage new files."
(IFS=$'\n'
for file in $(git ls-files --others --exclude-standard)
do
git add $file
echo "Staging " $file
done)
echo "Stage changed files."
(IFS=$'\n'
for file in $(git diff-index --name-only HEAD)
do
git add $file
echo "Staging " $file
done)
CHANGES_TO_COMMIT=$(git diff --name-only --cached | wc -w)
if [ "$CHANGES_TO_COMMIT" -gt 0 ]
then
echo "Commit changes."
git config --global user.name "GitHub Action"
git config --global user.email "[email protected]"
git commit -m "Update generated data with data-pipeline"
git push
else
echo "No changes to commit."
exit 0
fi