2021-01-28 18:15:47 +11:00
|
|
|
name: Minify Map JSON
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
2021-02-06 12:37:51 +11:00
|
|
|
- main
|
2021-01-28 18:15:47 +11:00
|
|
|
paths:
|
2021-01-28 18:42:47 +11:00
|
|
|
- 'boundaries.geo.json'
|
2021-01-29 21:10:39 +11:00
|
|
|
|
2021-01-28 18:57:43 +11:00
|
|
|
workflow_dispatch:
|
2021-01-29 21:10:39 +11:00
|
|
|
|
2021-01-28 18:15:47 +11:00
|
|
|
jobs:
|
2021-01-28 20:44:56 +11:00
|
|
|
processJson:
|
2021-01-29 10:38:23 +11:00
|
|
|
if: "!contains(github.event.head_commit.message, 'from hughrun/geo-to-topo')"
|
2021-01-28 18:15:47 +11:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-01-29 21:10:39 +11:00
|
|
|
|
2021-01-28 18:15:47 +11:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2021-01-29 21:10:39 +11:00
|
|
|
|
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-29 21:10:39 +11:00
|
|
|
|
2021-01-28 18:15:47 +11:00
|
|
|
- name: Create Pull Request
|
|
|
|
uses: peter-evans/create-pull-request@v3
|
|
|
|
with:
|
2021-02-01 19:47:36 +11:00
|
|
|
author: Library Map Bot <librarymap@hugh.run>
|
2021-01-28 18:15:47 +11:00
|
|
|
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 20:12:08 +11:00
|
|
|
labels: auto update,data
|