-
Notifications
You must be signed in to change notification settings - Fork 4
69 lines (58 loc) · 2.08 KB
/
updateCSV.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
58
59
60
61
62
63
64
65
66
67
68
69
name: UpdateCSV
on:
push:
branches: [cachehack]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout emergenzeHack/covid19italia
uses: actions/checkout@v2
with:
repository: emergenzeHack/covid19italia
- name: Get data repository name
run: |
echo "::set-output name=repo::${GITHUB_REPOSITORY%_*}_data"
id: get_data_repo
- name: Checkout ${{steps.get_data_repo.outputs.repo }}
uses: actions/checkout@v2
with:
repository: ${{steps.get_data_repo.outputs.repo }}
path: _data/machgen
- name: Cache gems
uses: actions/cache@v1
with:
path: vendor/bundle
key: ${{ runner.os }}-2.6.x-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-2.6.x-gems-
- name: Cache pips
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-3.x-pip
- uses: actions/setup-python@v1.2.0
with:
python-version: 3.x
- name: Install packages with pip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pip install lxml PyGithub pyyaml shapely pandas geopandas
- name: Recreate CSV, JSON and GeoJSON and push them
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
working-directory:
_data/machgen
run: |
mkdir -m 700 ~/.ssh
echo "${{ secrets.SSH_KEY }}" > ~/.ssh/id_ed25519
chmod 0600 ~/.ssh/id_ed25519
pushurl="git@github.com:$(git config --local remote.origin.url | sed 's;^https://github\.com/;;')"
git config remote.origin.pushurl "$pushurl"
git fetch origin
git reset --hard origin/master
../../scripts/github2CSV.py issues.csv issuesjson.json issues.geojson ../../_utilities ${{ secrets.ACCEPTED_LABEL }}
git config --local user.name "ehack-italy"
git config --local user.email "62019251+ehack-italy@users.noreply.github.com"
git commit -m "Aggiorno automaticamente dati $(date -Iseconds)" -- issues.csv issuesjson.json issues.geojson && git push || :