Update data #1778
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 | |
on: | |
schedule: | |
- cron: "0 */2 * * 1-5" # This means the workflow will run once every 2nd hours. | |
push: | |
branches: | |
- main # This means the workflow will also run on every push to the 'main' branch | |
jobs: | |
update_data: | |
name: Update data | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.x" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install setuptools | |
pip install -r requirements.txt | |
# pip install requests | |
# pip install selenium-wire | |
# pip install haralyzer | |
# pip3 install packaging | |
# pip install typing-extensions | |
- name: Update Avanza data | |
run: python fetchAvanzaData.py # Get data from Avanza | |
#- name: Update Skandia data | |
# run: python fetchSkandiaData.py # Get data from Skandia | |
- name: Commit and push | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git pull | |
git add . | |
git commit -m "Update data" -a || echo "No changes to commit" | |
git push |