2021-01-28 18:15:47 +11:00
|
|
|
name: Minify Map JSON
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
paths:
|
2021-01-28 18:42:47 +11:00
|
|
|
- 'boundaries.geo.json'
|
2021-01-28 18:57:43 +11:00
|
|
|
workflow_dispatch:
|
2021-01-28 18:15:47 +11:00
|
|
|
jobs:
|
2021-01-28 20:44:56 +11:00
|
|
|
processJson:
|
2021-01-29 09:50:15 +11:00
|
|
|
if: ${{ github.event.label.name != 'automated' }}
|
2021-01-28 18:15:47 +11:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2021-01-28 19:56:57 +11:00
|
|
|
- name: Update GeoJSON boundaries
|
2021-01-28 19:11:21 +11:00
|
|
|
run: |
|
|
|
|
sudo npm install -g mapshaper
|
2021-01-28 20:08:28 +11:00
|
|
|
mapshaper boundaries.geo.json snap -clean -o force precision=0.0001 format=geojson boundaries.geo.json
|
2021-01-28 19:11:21 +11:00
|
|
|
sudo npm install -g topojson-server
|
2021-01-28 20:08:28 +11:00
|
|
|
geo2topo boundaries.geo.json -q 50000 > website/data/boundaries.topo.json
|
2021-01-29 08:28:40 +11:00
|
|
|
python3 ./.github/scripts/merge_csv_to_topojson.py
|
2021-01-28 18:15:47 +11:00
|
|
|
- name: Create Pull Request
|
|
|
|
uses: peter-evans/create-pull-request@v3
|
|
|
|
with:
|
|
|
|
commit-message: Update TopoJSON boundaries
|
|
|
|
title: Update TopoJSON boundaries
|
2021-01-29 09:18:07 +11:00
|
|
|
body: 'Clean & minify GeoJSON; process to TopoJSON; merge library info csv to topo.'
|
2021-01-28 19:56:57 +11:00
|
|
|
branch: geo-to-topo
|
2021-01-29 09:18:07 +11:00
|
|
|
labels: automated,data
|