Skip to content

Download YouthMappers Org from OSMTeams #38

Download YouthMappers Org from OSMTeams

Download YouthMappers Org from OSMTeams #38

# 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
name: Download YouthMappers Org from OSMTeams
on:
schedule:
- cron: "0 10 * * 1,3,5"
workflow_dispatch:
permissions:
contents: read
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests pandas google-api-python-client gspread
- name: Run YouthMappers
env:
OSM_TEAMS_ACCESS_TOKEN: ${{ secrets.OSM_TEAMS_ACCESS_TOKEN }}
YGL_GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
run: |
python3 youthmappers.py --teams --osm --conflate --update
- name: Set Datestamp for file suffix
run: |
echo "DATESTAMP=$(date +"%Y-%m-%d")" >> ${GITHUB_ENV}
- name: Upload members.json to Google Drive
uses: adityak74/google-drive-upload-git-action@main
with:
credentials: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
filename: members.json
folderId: 1oEbib5Fa8oZJDdhMbpgcatQWtIFr9C9H
overwrite: True
- name: Upload chapters.json to Google Drive
uses: adityak74/google-drive-upload-git-action@main
with:
credentials: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
filename: chapters.json
folderId: 1oEbib5Fa8oZJDdhMbpgcatQWtIFr9C9H
overwrite: True
# - name: Upload Chapters to Google Drive
# uses: adityak74/google-drive-upload-git-action@main
# with:
# credentials: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
# filename: chapters.csv
# folderId: 1p6JeBvbsziMiBefCNet_q3nj9GvQWMnb
# name: chapters_${{env.DATESTAMP}}.csv
# overwrite: True
# - name: Upload YouthMappers to Google Drive
# uses: adityak74/google-drive-upload-git-action@main
# with:
# credentials: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
# filename: youthmappers.csv
# folderId: 1p6JeBvbsziMiBefCNet_q3nj9GvQWMnb
# name: youthmappers_${{env.DATESTAMP}}.csv
# overwrite: True