Scrape latest data #8615
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: Scrape latest data | |
on: | |
push: | |
workflow_dispatch: | |
schedule: | |
- cron: '37,59 11,14,20,21 * * *' | |
jobs: | |
scheduled: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out this repo | |
uses: actions/checkout@v2 | |
- name: Install packages | |
run: |- | |
pip install pandas | |
pip install alphaVantage-api | |
pip install python-dateutil | |
- name: Get ETF prices | |
run: |- | |
python src/get-and-transform-data.py --key ${{ secrets.ALPHAVANTAGE_KEY }} --etf true | |
shell: sh | |
- name: Commit and push if it changed | |
run: |- | |
git config user.name "Automated" | |
git config user.email "actions@users.noreply.github.com" | |
git add -A | |
timestamp=$(date -u) | |
git commit -m "Latest ETF data: ${timestamp}" || exit 0 | |
git push | |
- name: Get Mutual Fund prices | |
run: |- | |
python src/get-and-transform-data.py --key ${{ secrets.ALPHAVANTAGE_KEY }} --etf false | |
shell: sh | |
- name: Commit and push if it changed | |
run: |- | |
git config user.name "Automated" | |
git config user.email "actions@users.noreply.github.com" | |
git add -A | |
timestamp=$(date -u) | |
git commit -m "Latest Fund data: ${timestamp}" || exit 0 | |
git push |