From 7a2b83a97cf6e80a2892cc95ad2993101068ef64 Mon Sep 17 00:00:00 2001 From: Hugh Rundle Date: Fri, 29 Jan 2021 21:10:39 +1100 Subject: [PATCH] rationalise workflows - csv-to-topo updater now only works for PRs : csv shouldn't be directly updated in a push to master - csv-to-topo can now be manually triggered if needed - clearer formatting for actions --- .github/workflows/minify-map-json.yml | 5 ++++ .github/workflows/update-topo-on-info-pr.yml | 2 ++ .../workflows/update-topo-on-info-push.yml | 25 ------------------- 3 files changed, 7 insertions(+), 25 deletions(-) delete mode 100644 .github/workflows/update-topo-on-info-push.yml diff --git a/.github/workflows/minify-map-json.yml b/.github/workflows/minify-map-json.yml index c7893b5..eb4050f 100644 --- a/.github/workflows/minify-map-json.yml +++ b/.github/workflows/minify-map-json.yml @@ -5,15 +5,19 @@ on: - master 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 @@ -21,6 +25,7 @@ jobs: 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: diff --git a/.github/workflows/update-topo-on-info-pr.yml b/.github/workflows/update-topo-on-info-pr.yml index 276da9a..5b932ac 100644 --- a/.github/workflows/update-topo-on-info-pr.yml +++ b/.github/workflows/update-topo-on-info-pr.yml @@ -5,6 +5,8 @@ on: paths: - 'website/data/library_services_information.csv' + workflow_dispatch: + jobs: auto-topo-updater: runs-on: ubuntu-latest diff --git a/.github/workflows/update-topo-on-info-push.yml b/.github/workflows/update-topo-on-info-push.yml deleted file mode 100644 index 4becefa..0000000 --- a/.github/workflows/update-topo-on-info-push.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: topo auto updater (push) - -on: - push: - branches: - - "master" - paths: - - 'website/data/library_services_information.csv' - - '!website/data/boundaries.topo.json' -jobs: - auto-topo-updater: - runs-on: ubuntu-latest - steps: - - - uses: actions/checkout@v2 - with: - ref: ${{ github.head_ref }} - - - name: Merge CSV to TopoJSON - run: | - python3 ./.github/scripts/merge_csv_to_topojson.py - - - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: merge csv data to topo \ No newline at end of file