public_library_map/.github/workflows/minify-map-json.yml
Hugh Rundle 88cfcaf913 add condition to Action
The minify-map-json action is causing itself to run every time its PRs are merged.
This hopefully will stop that happening, but ignoring anything with an 'automated' label and then applying that label when pushing the PR
2021-01-29 09:50:15 +11:00

32 lines
1 KiB
YAML

name: Minify Map JSON
on:
push:
branches:
- master
paths:
- 'boundaries.geo.json'
workflow_dispatch:
jobs:
processJson:
if: ${{ github.event.label.name != 'automated' }}
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:
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: automated,data