Skip to content

Automated commit — New/Updated feed(s) (#570) #468

Automated commit — New/Updated feed(s) (#570)

Automated commit — New/Updated feed(s) (#570) #468

Workflow file for this run

name: Export catalogs to CSV
on:
push:
branches: [ main ]
paths:
- 'catalogs/**'
workflow_dispatch:
inputs:
upload_to_gcs:
description: 'true to upload the resulting csv to google so it becomes the official catalog csv'
required: false
default: 'true'
jobs:
export-to-csv:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest wheel numpy
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
sudo apt-get install gdal-bin python3-gdal
sudo apt-get install libgdal-dev
pip install GDAL==$(gdal-config --version) --global-option=build_ext --global-option="-I/usr/include/gdal"
sudo apt-get install libspatialindex-dev
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Export the catalog of sources as CSV
run: python3 scripts/export_to_csv.py
- name: Upload the catalog of sources CSV artifact
uses: actions/upload-artifact@v4
with:
name: sources.csv
path: sources.csv
store-csv:
needs: [ export-to-csv ]
runs-on: ubuntu-latest
# The user can opt out of uploading the csv if triggered by hand.
# If triggered by a push, always upload.
if: ${{ github.event.inputs.upload_to_gcs == 'true' || github.event_name == 'push' }}
steps:
- uses: actions/checkout@v4
- name: Download the catalog of sources CSV artifact
uses: actions/download-artifact@v4
with:
name: sources.csv
path: sources.csv
- name: Set up and authorize Cloud
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.ARCHIVE_DATASET_SA_KEY }}
- name: Upload csv to Google Cloud Storage
id: upload-csv
uses: google-github-actions/upload-cloud-storage@v2
with:
path: sources.csv
destination: mdb-csv
parent: false
- name: Load secrets from 1Password to be used for sending notification
id: onepw_secrets
uses: 1password/[email protected]
with:
export-env: true # Export loaded secrets as environment variables
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
CREDENTIALS: "op://rbiv7rvkkrsdlpcrz3bmv7nmcu/ifkeehu5gzi7wy5ub5qvwkaire/credential"
- name: Send a notification to mobility-feed-api
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ env.CREDENTIALS }}
repository: MobilityData/mobility-feed-api
event-type: catalog-sources-updated