Update build.yml #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Download and Process Data | |
on: | |
push: | |
branches: | |
- main # Run this workflow on pushes to the main branch | |
pull_request: | |
branches: | |
- main # Run this workflow on pull requests to the main branch | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y gdal-bin unzip | |
- name: Download file | |
run: wget -q https://naciscdn.org/naturalearth/110m/cultural/ne_110m_admin_0_countries.zip -O ne_110m_admin_0_countries.zip | |
- name: Unzip file | |
run: unzip ne_110m_admin_0_countries.zip -d ne_110m_admin_0_countries | |
- name: Convert SHP to GeoJSON | |
run: | | |
ogr2ogr -select admin,iso_a3 -f geojson ne_110m_admin_0_countries/ne_110m_admin_0_countries.geojson ne_110m_admin_0_countries/ne_110m_admin_0_countries.shp | |
- name: Output file | |
run: echo "GeoJSON file created:" | |
- name: Format file | |
run: | | |
cat ne_110m_admin_0_countries/ne_110m_admin_0_countries.geojson | sed \'s/"admin": /"name": /g\' | sed \'s/"iso_a3": /"ISO3166-1-Alpha-3": /g\' > ne_110m_admin_0_countries/ne_110m_admin_0_countries.geojson | |
- name: Upload build artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: geojson-output | |
path: ne_110m_admin_0_countries/ne_110m_admin_0_countries.geojson |