SyncDividendChampionsData #394
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: SyncDividendChampionsData | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 21 * * *' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/master' | |
steps: | |
- name: Check out repo | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.12 | |
- name: Configure pip caching | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Installed package list | |
run: |- | |
apt list --installed | |
- name: Install Python dependencies | |
run: |- | |
python -m pip install -r ./requirements.txt | |
python -m pip install -r ./requirements-dividend_champions_cron_job.txt | |
- name: Run sync dividend data | |
run: |- | |
python ./dividend_champions_cron_job.py | |
- name: Checkout Norn-StockScreener | |
uses: actions/checkout@v2 | |
with: | |
ref: gh-pages | |
repository: zmcx16/Norn-StockScreener | |
token: ${{ secrets.ACTIONS_TOKEN }} | |
path: ./Norn-StockScreener | |
fetch-depth: 0 | |
- name: Copy dividend & push Norn-StockScreener | |
run: |- | |
rm -rf ./Norn-StockScreener/norn-data/dividend | |
cp -r ./dividend ./Norn-StockScreener/norn-data/ | |
cd ./Norn-StockScreener | |
git config --global user.name "zmcx16-bot" | |
git config --global user.email "zmcx16-bot@zmcx16.moe" | |
git reset --soft "gh-pages^" | |
git add ./norn-data/dividend/\* && git commit -m "updated website" | |
git push -f |