-
Notifications
You must be signed in to change notification settings - Fork 1
72 lines (64 loc) · 2.01 KB
/
update.yaml
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Update imagineRio
on:
repository_dispatch:
types: [submodule-update]
workflow_dispatch:
jobs:
update-process:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
with:
submodules: true
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: "18"
- name: Install dependencies
run: npm install
- name: Fetch data
run: node imaginerio-etl/utils/fetchData.js
env:
JSTOR_USER: ${{ secrets.JSTOR_USER }}
JSTOR_PASSWORD: ${{ secrets.JSTOR_PASSWORD }}
JSTOR_PROJECT: ${{ secrets.JSTOR_PROJECT }}
- name: Build Docker image
run: docker build . -t etl
- name: Run Docker Image
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
ARCGIS_USER: ${{ secrets.ARCGIS_USER }}
ARCGIS_PASSWORD: ${{ secrets.ARCGIS_PASSWORD }}
VIEWCONES_LAYER_URL: ${{ secrets.VIEWCONES_LAYER_URL }}
run: |
docker run \
-e AWS_SECRET_ACCESS_KEY \
-e AWS_ACCESS_KEY_ID \
-e ARCGIS_USER \
-e ARCGIS_PASSWORD \
-e VIEWCONES_LAYER_URL \
-v $(pwd)/data:/usr/src/app/data \
etl
- name: Commit and push changes
run: |
cd data
git config --global user.name 'martimpassos'
git config --global user.email '[email protected]'
git add .
if git diff --staged --quiet; then
echo "No changes detected, skipping commit."
else
git commit -m "Update data"
git push
fi
cd ..
git add data
if git diff --staged --quiet; then
echo "No changes detected, skipping commit."
exit 0
else
git commit -m "Update submodule"
git push
fi