public_library_map/.github/workflows/minify-map-json.yml
Hugh Rundle 301e0e419d fix action conflict
The add-contributors action and the update-topo action both want to check out the current branch and add a commit at the same time, which causes conflicts. This adds contributors as part of the update-topo action and prevents the contributor update action running if `library_services_information.csv` has changed in the original commit.
2021-02-06 12:37:51 +11:00

39 lines
1.1 KiB
YAML

name: Minify Map JSON
on:
push:
branches:
- master
- main
paths:
- 'boundaries.geo.json'
workflow_dispatch:
jobs:
processJson:
if: "!contains(github.event.head_commit.message, 'from hughrun/geo-to-topo')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Update GeoJSON boundaries
run: |
sudo npm install -g mapshaper
mapshaper boundaries.geo.json snap -clean -o force precision=0.0001 format=geojson boundaries.geo.json
sudo npm install -g topojson-server
geo2topo boundaries.geo.json -q 50000 > website/data/boundaries.topo.json
python3 ./.github/scripts/merge_csv_to_topojson.py
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
author: Library Map Bot <librarymap@hugh.run>
commit-message: Update TopoJSON boundaries
title: Update TopoJSON boundaries
body: 'Clean & minify GeoJSON; process to TopoJSON; merge library info csv to topo.'
branch: geo-to-topo
labels: auto update,data