Skip to content

Download YouthMappers Org from OSMTeams #190

Download YouthMappers Org from OSMTeams

Download YouthMappers Org from OSMTeams #190

# This workflow runs the youthmappers.py script to perform the following actions:
# Download the latest YouthMappers data from OSM Teams
# Conflate the latest data against the previous lists on Google Drive
# Update the latest spreadsheets on Google Drive
# Write the latest JSON files to Google Drive
# Update the youthmappers.tsv file on AWS S3
name: Download YouthMappers Org from OSMTeams
on:
push:
branches: main
schedule:
- cron: "0 10 * * 1,3,5"
workflow_dispatch:
permissions:
contents: read
id-token: write
jobs:
run:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests pandas google-api-python-client gspread
- name: Obtain latest list of YouthMappers
env:
OSM_TEAMS_ACCESS_TOKEN: ${{ secrets.OSM_TEAMS_ACCESS_TOKEN }}
YGL_GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
run: python3 youthmappers.py --source=teams --conflate --osm --update --google --athena
- name: Fetch AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: arn:aws:iam::812718984223:role/YouthMappersGithubAssumeRole
aws-region: us-east-1
- name: Update chapters list on s3
run: aws --region us-east-1 s3 cp chapters.json s3://youthmappers-internal-us-east1/json/chapters.json
- name: Update mappers list on s3
run: aws --region us-east-1 s3 cp members.json s3://youthmappers-internal-us-east1/json/mappers.json
- name: Update TSV for Athena on s3
run: aws --region us-east-1 s3 cp youthmappers.tsv s3://youthmappers-internal-us-east1/mappers/youthmappers.tsv