Skip to content

Download CSV from Google Drive #457

Download CSV from Google Drive

Download CSV from Google Drive #457

Workflow file for this run

name: Download CSV from Google Drive
on:
schedule:
- cron: '30 22 * * *'
jobs:
download:
runs-on: ubuntu-latest
steps:
- name: Check out the code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: pip install gdown
- name: Download CSV from Google Drive
run: |
# Specify the Google Drive file ID for your CSV
file_id="1DXYTtzUVVxWSu9wDBjNDZW5YrLKJtiWL"
# Specify the output file name
output_file="new-singles.csv"
# Download the file
gdown "https://drive.google.com/uc?id=$file_id" -O site/$output_file
env:
file_id: ${{ secrets.GOOGLE_DRIVE_FILE_ID }}
- name: Configure Git
run: |
git config user.name "nhlocal"
git config user.email "[email protected]"
- name: Commit changes
run: |
git add -f site/
git commit -m "Add downloaded CSV to the 'site' folder"
- name: Push changes
run: |
git push