Skip to content

OptionPCRData

OptionPCRData #235

name: OptionPCRData
on:
workflow_dispatch:
schedule:
- cron: '0 22 * * 1,2,3,4,5'
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
- 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 master folder
run: |-
rsync -Rr ./ ./master/
- name: Checkout data branch
run: |-
git checkout data
- name: Install Python dependencies
run: |
python -m pip install -r ./master/requirements.txt
- name: Run update option data
env:
AF_URL: ${{ secrets.AF_URL }}
AF_TOKEN: ${{ secrets.AF_TOKEN }}
run: |-
python ./master/option_pcr_cron_job.py
- name: Copy output
run: |-
cp -r ./master/output/* ./data-output/
- name: Delete master folder
run: |-
rm -rf ./master
- name: Add option data and push it
run: |-
git config --global user.name "zmcx16-bot"
git config --global user.email "zmcx16-bot@zmcx16.moe"
git config --global pull.ff only
git pull
git reset --soft HEAD~1
git add ./data-output/\* && git commit -m "updated data"
git push -f