Skip to content

ParseESGAndBenfordData #332

ParseESGAndBenfordData

ParseESGAndBenfordData #332

name: ParseESGAndBenfordData
on:
workflow_dispatch:
schedule:
- cron: '15 0 * * *'
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.8
- uses: actions/cache@v2
name: Configure pip caching
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Copy github ci files to ci-folder
run: |-
cp -r ./.github/parse_esg_data ./ci-folder
- name: Checkout gh-pages branch
run: |-
git checkout gh-pages
- name: Checkout Norn-Finance-API-Server data branch
uses: actions/checkout@v2
with:
repository: zmcx16/Norn-Finance-API-Server
path: ./.github/Norn-Finance-API-Server
ref: data
fetch-depth: 0
- name: Delete old esg & Benford data
run: |-
rm -rf ./norn-data/esg
rm -f ./norn-data/stock-benford-law.json
- name: Copy esg & benford data from Norn-Finance-API-Server
run: |-
mkdir -p ./norn-data/esg/data
cp -r ./.github/Norn-Finance-API-Server/data-output/esgChart ./norn-data/esg/data
cp ./.github/Norn-Finance-API-Server/data-output/stock-benford-law.json ./norn-data
- name: Install Python dependencies
run: |
python -m pip install -r ./ci-folder/requirements.txt
- name: Parse ESG data
run: |-
python ./ci-folder/parse_esg_data.py
- name: Delete ci-folder
run: |-
rm -rf ./ci-folder
- name: Add norn-data and push it
run: |-
git config --global user.name "zmcx16-bot"
git config --global user.email "[email protected]"
git config --global pull.ff only
git pull
git reset --soft HEAD~1
git add ./norn-data/\* && git commit -m "updated website & esg-data"
git push -f