FetchGurusData #1244
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: FetchGurusData | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 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/fetch_gurus_data ./ci-folder | |
- name: Checkout gh-pages branch | |
run: |- | |
git checkout gh-pages | |
- name: Install Python dependencies | |
run: | | |
python -m pip install -r ./ci-folder/requirements.txt | |
- name: Fetch gurus data | |
env: | |
MARKET_URL: ${{ secrets.MARKET_URL }} | |
MARKET_TOKEN: ${{ secrets.MARKET_TOKEN }} | |
run: |- | |
python ./ci-folder/fetch_gurus_data.py | |
- name: Delete ci-folder | |
run: |- | |
rm -rf ./ci-folder | |
- name: Add norn-data and push it | |
run: |- | |
git config --global pull.ff only | |
git config --global user.name "zmcx16-bot" | |
git config --global user.email "[email protected]" | |
git pull | |
git reset --soft HEAD~1 | |
git add ./norn-data/\* && git commit -m "updated website & norn-data" | |
git push -f |