This repository has been archived by the owner on Sep 19, 2023. It is now read-only.
Data update #94
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: Data update | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '30 0 * * *' | |
permissions: | |
contents: write | |
jobs: | |
data-update-job: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 17 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.11" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -q poetry | |
- name: Install project | |
run: | | |
poetry config virtualenvs.in-project true | |
poetry install --no-root | |
- name: Update data | |
run: | | |
source .venv/bin/activate | |
rm -rf *.csv | |
python app.py | |
rm -rf *.json | |
mv export.csv/ out/ | |
mv out/*.csv export.csv | |
env: | |
GRANT_TYPE: ${{ secrets.GRANT_TYPE }} | |
CLIENT_ID: ${{ secrets.CLIENT_ID }} | |
SECRET: ${{ secrets.CLIENT_SECRET }} | |
SCOPE: ${{ secrets.SCOPE }} | |
- name: Push result | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "tkhadir" | |
git add export.csv | |
git commit -m "feat: add results" | |
git push origin |