Update Data Repo #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update Data Repo | |
on: | |
workflow_call: | |
workflow_dispatch: | |
jobs: | |
download-bigquery-agg: | |
runs-on: ubuntu-latest | |
steps: | |
- id: "checkout" | |
uses: "actions/checkout@v3" | |
- id: "python" | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
cache: "pip" | |
- id: "pip" | |
run: pip install . | |
- id: "auth" | |
name: "Authenticate to Google Cloud" | |
uses: "google-github-actions/auth@v1" | |
with: | |
credentials_json: ${{ secrets.bq }} | |
- id: "download" | |
run: "python3 -m cruxdownloader data" | |
- id: "commit" | |
name: Commit and push if it changed | |
run: |- | |
git config user.name "Automated" | |
git config user.email "[email protected]" | |
git add data/* | |
timestamp=$(date -u) | |
git commit -m "Latest data: ${timestamp}" || exit 0 | |
git push |