OptionPCRData #362
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: 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 "[email protected]" | |
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 |