Scripts to generate the file and api update to grab what exists

This commit is contained in:
zandercymatics 2023-11-21 14:28:31 -07:00
parent e52954f984
commit bca311b8ca
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
6 changed files with 145 additions and 35 deletions

49
.github/workflows/daily-csv-upload.yaml vendored Normal file
View file

@ -0,0 +1,49 @@
name: Upload current-full.csv and current-federal.csv
on:
push:
paths-ignore:
- 'docs/**'
- '**.md'
- '.gitignore'
branches:
- rjm
pull_request:
paths-ignore:
- 'docs/**'
- '**.md'
- '.gitignore'
branches:
- rjm
schedule:
# Runs every day at 5 AM UTC
- cron: '0 5 * * *'
jobs:
upload_reports:
runs-on: ubuntu-latest
if: github.event_name == 'schedule'
steps:
- uses: actions/checkout@v3
- name: Install CF CLI
run: |
curl -L "https://packages.cloudfoundry.org/stable?release=linux64-binary&source=github" | tar -zx
sudo mv cf /usr/local/bin
- name: Login to cloud.gov
run: |
cf api https://api.fr.cloud.gov
cf auth ${{ secrets.CF_USERNAME }} ${{ secrets.CF_PASSWORD }}
cf target -o ${{ secrets.CF_ORG }} -s ${{ secrets.CF_SPACE }}
- name: Run task
run: cf run-task my-app "/tmp/lifecycle/shell -c './manage.py generate_current_full_and_federal_reports.py'"
- name: Commit and push CSV files
run: |
git config --global user.name 'GitHub Actions'
git config --global user.email 'actions@github.com'
git add current-full.csv current-federal.csv
git commit -m "Update CSV files"
git push